Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between redux and dutier #3

Closed
thiamsantos opened this issue Jun 12, 2017 · 6 comments
Closed

Differences between redux and dutier #3

thiamsantos opened this issue Jun 12, 2017 · 6 comments

Comments

@thiamsantos
Copy link

What are the main differences between dutier and redux?

@luisvinicius167
Copy link
Owner

luisvinicius167 commented Jun 12, 2017

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.

@piyushchauhan2011
Copy link

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 💯

@luisvinicius167
Copy link
Owner

luisvinicius167 commented Jun 14, 2017

@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!!

@developit
Copy link

Seems like the biggest difference is that dutier is a singleton?

@luisvinicius167
Copy link
Owner

@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!

@luisvinicius167
Copy link
Owner

Dutier v0.0.3 available now! Thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants