Possible to respond on a Promise?
See original GitHub issueHi,
I’m trying to dispatch a POST and once data is retrieved, then change the page to either a success or a failure page (has to be a different page and not just a toastr message that pops up)
The following, obviously, won’t work (in my form component):
this.props
.dispatch('requestquote', this.state)
.then(console.log('submit'));
How would I be able to tell if the POST was successful (or failed for any reason) and then continue to load a different route?
Or would you suggest abandoning the idea of a central store and just post within the component itself?
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
What do you do when someone promises something ... - Quora
Ask them how long they have been doing what they do. Ask if they always let things go slack and not professionally dealt...
Read more >reply to new on promises - by pall s. ardal - JSTOR
New is too generous to me in allowing that I could have concluded that "some promises are statements and others are not "....
Read more >Here's How To Retract A Promise And Still Appear Professional
The first thing you need to do is figure out how this promise came to be. Go back through old emails or talk...
Read more >8 Ways to Actually Deliver on Your Promises - Lifehack
5. Be communicative ... When you make your promise, be as concise as possible. If the description of your promise is vague, then...
Read more >10 Ways to Say 'I Will Get Back to You as Soon as Possible'
I've passed this question to our team. They should have an answer by , but I'll be sure to update you as soon...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I still stink that you should move
to store module and not keeping it in a component.
In Storeon we splitting the app into “logic” and “UI”. It was a core idea of creating the Storeon (for instance, routing is a store module, not a component as in React Router).
If we want to split into “domain” and “local” logic, we will have completely different API (Effector is much closer to it).
Hello!
I have use-case for this issue.
I want do something in store (e.g. login user) and after it close login modal or redirect user to another page. This actions (modals, redirects) not “domain” actions. It is UI actions. But now, I must write many boilerplate code for this case.
Now:
With returning Promise:
Also, this API change reduce boilerplate in store definition.
@ai what do you think?