hydux-data
Data-driven appication in hydux, in the Elm way, inspired by apollo-client.
Install
yarn add hydux-data # or npm i hydux-data
Usage
This package can make your daily work easier. When you get lot's of views which just rendering some data from server, with less user interaction, this package will add isLoading flag and fetch error handler automatically for your each fetch function.
Let's say we already get an api function, like this fake one, it takes some parameters and return a promise can resolve as a data, or reject as an error (message
propertie is required and would be used later).
Now we can make a loadable api to generate some state and actions.
Here is the generated state and actions
state = actions =
Example App
git clone https://github.com/hydux/hydux-data.gitcd examples/counteryarn # or npm i npm start
Now open http://localhost:8080 and hack!
License
MIT