Closed
Description
As in the docs, the decorator @observes
could couple the counter with the counterStore, instead of giving it the freedom from receiving the counter from any data source via props.
I like flummox's FluxComponent
way of doing stuff: your component is pure and a top-level component chooses how to feed it.
import { Observes } from 'redux/components';
<Observes store="counterStore">
<Counter /* counter={counterStore.counter} */ />
</Observes>
For the @performs
decorator we could have an equivalent component that wires an event of a component (e.g. onClick
, onIncrement
) with an action.
import { Performs } from 'redux/components';
import increment from './actions/CounterActions.js';
<Performs actions={{'onClick': increment}}>
<IncrementButton />
</Performs>
I think we have much more power using components this way. More testable and reusable.
I'm far from being an expert on decorators and even on Flux, so please show your views and let's discuss this thread 😄
Metadata
Metadata
Assignees
Labels
No labels