Effector

Effector

  • Docs
  • Try
  • API
  • Blog
  • Twitter
  • GitHub

›effector-react

effector

  • API Reference
  • Event
  • Store
  • Effect
  • Domain
  • createStore
  • createEvent
  • createEffect
  • createDomain
  • createStoreObject
  • combine
  • restore
  • createApi
  • clearNode
  • merge
  • split
  • sample
  • guard
  • forward
  • fromObservable

effector-react

  • API Reference
  • useStore
  • useStoreMap
  • useList
  • createComponent
  • Gate
  • createGate
  • useGate
  • createStoreConsumer

effector-vue

  • API Reference
  • VueEffector
  • ComponentOptions
  • Vue
Edit

createGate(name?)

Creates a Gate

Arguments

  1. name? (string)

Returns

(Gate)

Example

import React from 'react'
import ReactDOM from 'react-dom'
import {createGate} from 'effector-react'

const Gate = createGate('gate with props')

const App = () => (
  <section>
    <Gate foo="bar" />
  </section>
)

ReactDOM.render(<App />, document.getElementById('root'))

console.log(Gate.state.getState()) // -->  {foo: 'bar'}
console.log(Gate.current) // -->  {foo: 'bar'}

ReactDOM.unmountComponentAtNode(document.getElementById('root'))

console.log(Gate.state.getState()) // --> {}
console.log(Gate.current) // -->  {}
← GateuseGate →
Effector
Docs
Getting StartedAPI Reference
Community
User ShowcaseStack OverflowGitterTwitter
More
GitHubStar
Copyright © 2019 zerobias