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

Gate

Gate is a hook for conditional rendering, based on current value (or values) in props. An example of a problem that a Gate can solve - you can put together all required data, when component was mounted. Or show another component, if there is not enough data in props. Gate also looks good for Routing or animation, ReactTransitionGroup like.

This allows you to send props back to Store to create feedback loop interop.

Gate can have two states:

  • Open, which means mounted
  • Closed, which means unmounted

Gate Methods

childGate(childName?)

Returns child gate which won't render if parent gate is closed.

Returns

(Gate): Child gate


Gate Properties

isOpen

Returns

(boolean)


isTerminated

Returns

(boolean)


open

Returns

(Event)


close

Returns

(Event)


status

Returns

(Store)


destructor

Returns

(Event)


current

Returns

(Props)


state

Returns

(Store)


← createComponentcreateGate →
  • Gate Methods
    • childGate(childName?)
  • Gate Properties
    • isOpen
    • isTerminated
    • open
    • Returns
    • close
    • Returns
    • status
    • Returns
    • destructor
    • Returns
    • current
    • Returns
    • state
    • Returns
Effector
Docs
Getting StartedAPI Reference
Community
User ShowcaseStack OverflowGitterTwitter
More
GitHubStar
Copyright © 2019 zerobias