Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import StateProxy from "./state-proxy";
- const {params, dispatch, state} = this.props,
- {organization, trip} = params;
- // Proxy objects are light-weight & contain very little of own state. Just a mechanism for
- // traversing a state tree.
- // Only StateProxy instance holds reference to state tree.
- // The idea is it would be created after memoized selectors are run in mapStateToProps() or render().
- let stateProxy = new StateProxy(dispatch, state),
- tripProxy = stateProxy.trip(organization, trip),
- // Traversing relationship; returns a RecordProxy object.
- recordProxy = tripProxy.tripDetail();
- console.log(tripProxy.data(), recordProxy.data());
- for (tripProxy of stateProxy.trips(organization)) {
- console.log(tripProxy.data(), tripProxy.tripDetail().data());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement