Predictable state container for JavaScript apps
3 Jun 2015 · Newest first
Last checked
Checking sources…
Showing 1 of 1 releases. Full release notes.
Signals highlight changes worth reviewing. They cannot determine whether your application is affected.
0.2.2 → 0.3.0
Complete rewrite.
// The smart component may inject actions
// and observe stores using <Container />:
import React, { Component } from 'react';
import { Root, Container } from 'redux';
import { increment, decrement } from './actions/CounterActions';
import counterStore from './stores/counterStore';
import Counter from './Counter';
export default class CounterContainer {
render() {
// stores can be a single store or an array.
// actions can only be a string -> function map.
// props passed to children will combine these actions and state.
return (
<Container stores={counterStore}
actions={{ increment, decrement }}>
{props => <Counter {...props} />}
</Container>
);
}
}
Minor caveat: Store function names are now significant.