Closed fahad19 closed 6 years ago
Also would be nice to have something like:
function someFunction(app) {
return new Map([
['someVariable', app.get('service').getSomeVariable()],
[app.get('region').getData$(), ({ regionProp }) => ({ regionProp })],
]);
}
export default connect(
mapStateToProps,
dispatchableActions,
someFunction
)(MyComponent);
Then iterate the Map
in connect
function
@maximuk: if you need app
, isn't it better to use only existing observe
HoC from frint-react
? :)
if we go ahead with #391, this proposal can be considered redundant.
Closing this in favour of #391
(Intended to be done outside of this repository, after #378 is done)
Currently
To connect our
frint-store
's actions/state to components, we use ourobserve
HoC like this:Proposal
To make it easier for developers, we can have a
connect
HoC (similar to that found inreact-redux
).Example usage:
Implementation
The code for
connect
HoC can be something like this:Further reading
frint-store
: https://frint.js.org/docs/packages/frint-store/