fluorine-lib
Version:
Reactive state and side effect management for React using a single stream of actions
14 lines (11 loc) • 457 B
JavaScript
import connectStore from './connectStore';
export default function withStore(store) {
var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'data';
var pureProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
if (typeof store === 'function') {
return connectStore(function (_, props) {
return store(props);
}, prop, pureProps);
}
return connectStore(store, prop, pureProps);
}