0.13.7This is the global AppDispatcher. Every action must go through the AppDispatcher.
Returns a Kefir.pool() that we use a bus.
Kefir.pool:
A channel consists of:
See createChannels for more details.
A saga consists of:
sagas interface and
returns the SagaHandlers.See createSagas for more details.
A middleware is function with the following signature: store => next => action
{AppState, AppDispatcher}:
the AppState and its dispatcher to send messages.
Hey, look! Something like a monad (dang, forget I said the "m" word.)
StateWithSideEffects is basically state plus an array of messages (the side
effects to be executed).
You can combine it with State or with another StateWithSideEffects, or add side effects to an existing StateWithSideEffects.
(any)
(any)
Can combine StateWithSideEffects with another StateWithSideEffects or with state.
((StateWithSideEffects | State))
StateWithSideEffects:
the result
Constructor helper
(State
= {})
StateWithSideEffects:
instance
Natural interface---just wrap a child view in this container class and pass values via props. No complex state functions. Because it supports parent React props, it can be inefficient for arbitrary prop changes.
Extends React.Component
(any)
(any)
Doesn't support parent React props. However, you can define complex state functions.
Do NOT use anonymous functions to define getInitialState, getObservableState, getDefaultProps!
(Object)
| Name | Description |
|---|---|
opts.getDefaultProps Function
(default ()=>{})
|
container default props. Passed to child as props. |
opts.getInitialState Function
(default ()=>{})
|
container initial state. Passed to child as props. |
opts.getObservableState Function
(default ()=>{})
|
pass observables here. Observable values passed to child as props |
opts.propTypes any
(default {})
|
container propTypes. |
Function:
that receives the child view
Supports parent React props at the expense of potentially being inefficient:
Every #componentWillReceiveProps forces observer re-initialization. Therefore it is your responsibility to ensure that it doesn't get called too often.
Since container props and state both get mapped as child props, state overriddes props with the same name.
Do NOT use anonymous functions to define getInitialState, getObservableState, getDefaultProps!
(Object)
| Name | Description |
|---|---|
opts.getDefaultProps Function
(default ()=>{})
|
container default props. Passed to child as props. |
opts.getInitialState Function
(default ()=>{})
|
container initial state. Passed to child as props. |
opts.getObservableState Function
(default ()=>{})
|
pass observables here. Observable values passed to child as props |
opts.propTypes any
(default {})
|
container propTypes. |
opts.__dangerouslyEnableSlowness any
(default true)
|
Function:
that returns the container
Creates a special channel for redux reducers. The main differences between this and
createChannels are:
createChannels assumes a single reducer per action type. createReduxReducers
passes all actions to every reducer, as per the redux style.createChannels maps each channel to a single top-level state property.
createReduxReducers maps every reducer to a top-level state property. But
internally, all messages flow through a single redux channel.Currently, redux#combineReducers is not supported.
To pass a message to a redux reducer from an rflux app, use this format:
Function:
the redux reducers channel
This is the reserved redux channel name used internally. Do NOT use this as a channel name.
This injects the middleware into the AppDispatcher. Middleware can stop propagation of events to observables by not calling "next(action)". Middleware can also transform actions or dispatch their own actions.
MiddlewareFactory:
factory
This AppDispatcher is middleware aware.
kefirEmitter:
the AppDispatcher
Call the action and return the result (as an observable)
(string)
Object:
redux middleware