Question about onStart execution order
See original GitHub issueIn the following example I was expecting āonStartā callback to be invoked first, but noticed it was run last:
https://codepen.io/ejez/pen/NWjWBoJ
const src = fromArray([0, 1]);
const { unsubscribe } = pipe(
src,
onStart(() => console.log("onStart...")),
onPush(() => console.log("onPush...")),
onEnd(() => console.log("onEnd...")),
subscribe((result) => console.log(result))
);
result:
"onPush..."
0
"onPush..."
1
"onEnd..."
"onStart..."
From the docs:
When the stream starts then the sink is called with Start, Then for every incoming, new value itās called with Push('a), and when the stream ends itās finally called with End.
onStart Run a callback when the Start signal is sent to the sink by the source.
Many thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Execution order of OnActivityResult and OnResume
I'm finding it gets called before OnResume, and even before OnStart. My sample code is below, I'm breakpointing the relevant methods to see...
Read more >Confused about execution order in .NET MAUI #8088 - GitHub
NET MAUI app. In my case, it was going to the OnAppearing() method of LoginPage because it's the first item in the Shell...
Read more >App.StartScreen: a new declarative alternative to Navigate in ...
If App.OnStart contains a Navigate function call, even if it is in an If function and rarely called, we must complete execution of...
Read more >Execution order of Trigger, Workflow and Process
Answer to your first question: 1. Update trigger runs before Process and if Process has field update, it againĀ ...
Read more >The activity lifecycle | Android Developers
Activity B's onCreate() , onStart() , and onResume() methods execute in sequence. (Activity B now has user focus.) Then, if Activity A is...
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!
What i did, is adding a condition for setting
fetching
totrue
inonSart
(only when there is no data, ie first fetch). I will change it as per your suggestion, as it seemsonStart
is not the natural place for setting the fetching state.yea, sounds good š Iāll close this for now, since I think the question itself is addressed.
The problems here and ambition is basically always with synchronous streams. The synchronous support in Wonka allows us to apply some nice tricks in urql, but that does come with some caveats. Synchronous events are just very different from asynchronous as itāll always deal with an exact order.