Pattern: Waiting for Stores?
See original GitHub issueHi,
Couldn’t find any documentation about this one, so I might be thinking of it completely wrong, but here’s my situation, would love to hear some thoughts about it:
My app has a login mechanism which eventually can send different actions (FB_LOGIN_SUCCESS, GOOGLE_LOGIN_SUCCESS, …) that are received by a reducer which stores a computed access-token.
I have a saga that needs to send a request with the access-token, so what I want to do in pseudo code in many of my different sagas is:
access-token = [select access token from store]
if [there isn't an access-token] then [wait for the store to have one]
[call api with access-token]
How can I do the [wait for store to have one]? What is the correct pattern here?
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
I am waiting for you in my store Kowshop - Pinterest
Technique: 2 drops brick stitch+fringe PDF file consists of: - Pattern (without bead color numbers). The colors used are indicated next to the...
Read more >New Checkout Experience Seeks to Eliminate the Wait ...
All the cashiers in the store transitioned to a new type of job called 'Host.' It's the Host's job to make sure the...
Read more >Is there a better waiting pattern for c#? - Stack Overflow
A much better way to implement this pattern is to have your Thing object expose an event on which the consumer can wait....
Read more >Waiting pattern by Siew Clark - Ravelry
It is a one-piece, top-down, reversible, symmetrical, crescent shawl which you can make it bigger by using thicker yarn and bigger knitting ...
Read more >How Shopping Habits Changed Due to COVID-19
Consumers shopping patterns have changed since the pandemic, with more emphasis on ... As shoppers grew accustomed to waiting in lines, online shopping...
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 FreeTop 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
Top GitHub Comments
Thanks!
I don’t 100% love this idea (of going by action string, as it means my other sagas need to know about the actions of the login saga).
For the meanwhile, i simply have:
Not pretty at all, but works.
Another way is to hold a reference to the task doing the login; and share it with the other Sagas needing to wait for a login for ex. by making it a param