Comments (6)
@piyushchauhan2011 I'll provide some examples with api requests, but I think you can make an api request inside your component and them dispatch an action with response, chaining your dispatch and then update the component state with the new state value, returned by dispatch method. But the fetch will be present inside your component, not in your actions... Thanks!!
from dutier.
Dutier v0.0.3 available now! Thanks folks!
from dutier.
I think Dutier
shares the same principles that Redux
, actions that return payloads that says how to work with the state without change them, just returning new values usign your state.
But dutier createStore
just sets your initial application state. Inside your components you will dispatch actions to be called by your reducers for change the state.
Dutier dispatch
method is async by default
, always returns a Promise with the action type and the new state value changed by your action.
Dutier has a tiny size (1.5kb), no dependencies, tiny API and it's very easy to get started with React, Vue, Preact, any Frameworks.
from dutier.
Seems like the biggest difference is that dutier is a singleton?
from dutier.
Are there any pattern for making api
requests ? like using async
and await
and updating the state like we do in Redux Saga ? @luisvinicius167
It looks great, tiny and relevant 💯
from dutier.
@developit yeah! So, it's because dutier createStore just sets the initialState and the reducers will return new state values and update the current state. With this, you don't need to pass a store instance over your components... Thanks for comment!
from dutier.
Related Issues (4)
- README typo HOT 1
- Provider.__reducers HOT 1
- Async Reducers HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dutier.