The "Reward Me Now" data layer is a frontend library which uses higher order reducers to consume data from the reward-network-layer.
Install
Install with npm:
npm install @redu/reward-data-layer --save
Usage
The reducers consume actions from the reward-network-layer by default. This packages exposes multiple higher order reducers which you can use to automatically populate your store and run complex selectors on the data.
import { withOrders } from "@redu/reward-data-layer";
export default combineReducers({
orders: withOrders()((state, action) => state),
});
You can use the exported reducer to wrap your own reducer and overwrite actions. As default
the code above will populate the orders
store key with: { data: [] }
and conume actions from the reward-network-layer to populate this data.
Dependencies
- lodash to perform advance data parsing.
- fuse.js to perform advanced search in our selectors.
- dayjs is used to parse dates in the selectors.