Giter VIP home page Giter VIP logo

Comments (6)

luisvinicius167 avatar luisvinicius167 commented on May 14, 2024 2

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

luisvinicius167 avatar luisvinicius167 commented on May 14, 2024 2

Dutier v0.0.3 available now! Thanks folks!

from dutier.

luisvinicius167 avatar luisvinicius167 commented on May 14, 2024 1

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.

developit avatar developit commented on May 14, 2024 1

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

from dutier.

piyushchauhan2011 avatar piyushchauhan2011 commented on May 14, 2024

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.

luisvinicius167 avatar luisvinicius167 commented on May 14, 2024

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.