Comments (6)
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.
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.
Yes, you would have an application store or something similar that could manage the state.
from fluxible.
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.
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.
@cesarandreu could you show me an example of that? gist?
from fluxible.
Related Issues (20)
- Support registering services that return promises HOT 4
- Some properties are not showing. HOT 1
- compatibility with React v16 HOT 4
- An in-range update of babel-eslint is breaking the build π¨ HOT 3
- An in-range update of sinon is breaking the build π¨ HOT 5
- [addons-react] Following React 16.3+ new Context API ? HOT 7
- componentWillReceiveProps to getDerivedStateFromProps HOT 5
- Version 10 of node.js has been released HOT 1
- [fluxible] context.executeAction(action, null, callback) invokes the callback before the async action finishes HOT 1
- An in-range update of react is breaking the build π¨ HOT 2
- An in-range update of react is breaking the build π¨ HOT 25
- Should dispatch NAVIGATE_FAILURE if action is not able to resolve HOT 2
- An in-range update of eslint-plugin-react is breaking the build π¨ HOT 12
- Update React lifecycle methods HOT 2
- [fluxible-addons-react] react 16 task list HOT 26
- TypeError: this.props.currentRoute is null HOT 2
- Render a component when error occurs HOT 1
- Question regarding debug dependency HOT 6
- Update Access the context site docs
- useStore hook HOT 6
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 fluxible.