Giter Club home page Giter Club logo

Comments (6)

redonkulus avatar redonkulus commented on July 20, 2024

Typically, we would fire an optimistic update to display the UI as if the XHR succeeded or show a loading screen while the XHR call is in progress. You can see an example of the events being fired in our ToDo example. The UPDATE_TODO_START triggers the store callback, which can modify the store state and notify the component.

from fluxible.

geekyme avatar geekyme commented on July 20, 2024

In other words… moving UI state into the store?

On 3 Feb 2015, at 11:53 pm, Seth Bertalotto [email protected] wrote:

Typically, we would fire an optimistic update to display the UI as if the XHR succeeded or show a loading screen while the XHR call is in progress. You can see an example of the events being fired in our ToDo example https://github.com/yahoo/flux-examples/blob/master/todo/actions/updateTodo.js. The UPDATE_TODO_START triggers the store callback, which can modify the store state and notify the component.

β€”
Reply to this email directly or view it on GitHub #34 (comment).

from fluxible.

redonkulus avatar redonkulus commented on July 20, 2024

Yes, you would have an application store or something similar that could manage the state.

from fluxible.

mohammedpithapurwalasc avatar mohammedpithapurwalasc commented on July 20, 2024

This seems like a terrible way to handle UI state. May be a better approach is to have UI listen for these events directly in the dispatcher ?

from fluxible.

cesarandreu avatar cesarandreu commented on July 20, 2024

I keep all state in stores. If it's something ephemeral (e.g. it doesn't affect anything else) I'll wrap my controller component with an automated one.

from fluxible.

bjrmatos avatar bjrmatos commented on July 20, 2024

@cesarandreu could you show me an example of that? gist?

from fluxible.

Related Issues (20)

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.