MCPcopy Create free account
hub / github.com/developit/state-machine-component / action

Function action

src/index.js:7–9  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 Component.call(this);
6 let cache = {};
7 let action = type => cache[type] || (cache[type] = data => {
8 this.setState(reducer(this.state, { type, data, props: this.props }));
9 });
10 this.render = (props, state) => render(state, action);
11 this.componentWillReceiveProps = action('@@PROPS');
12 this.componentWillMount = action('@@INIT');

Callers 1

MachineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected