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.
Gate can have two states:
- Open, which means mounted
- Closed, which means unmounted
Returns child gate which won't render if parent gate is closed.
(Gate): Child gate
Event which will be called during gate mounting
Event which will be called during gate unmounting.
Boolean store which show if given gate is mounted.
Store with current state of given gate