canGoBack logic fixed according to documentation for Flow::goBack.#197
canGoBack logic fixed according to documentation for Flow::goBack.#197novachevskyi wants to merge 1 commit intosquare:masterfrom
Conversation
|
|
|
If |
|
bump for this one. .goBack() will return flow to first key, if called on second while third is adding (pending traversal, dispatched state) |
|
I just ran into this same problem, and my issue is that the approach in this PR is just that sometimes you do want a goBack to happen, just not based on the History during the transition. So in this scenario: Crashing in this scenario is obviously bad, but I'm not sure the right fix is for that I'd much rather have the Thoughts? |
|
@edenman I agree. There's still a corner case, though: what should happen if the history size is 1 by the time the function fires? We can't return My inclination is that calling
If no one shouts me down I'll implement that. cc @Zhuinden |
|
@edenman your scenario will still be kind of racy though. You're relying on no one else making a surprise call to I think the real solution to that is something like the Transforms that @ChrisRenke sketched in #191, but that's another yak to shave another day. |
|
@rjrjr even better: expose the "enqueue a function" as a first-class API, so then I can write something like: |
|
@edenman So presuming I succumb to temptation and write the fun thing, which would be in character, that brings us back to the correct behavior for goBack(). With the functional capability in hand I'd be inclined to go conservative on goBack() and use @Zhuinden 's fix -- during a transition return true and ignore the request. |
|
@rjrjr I guess I'm ok with that? I'll probably stop using |
In response to the discussion in #197. Allows app code to mutate the history safely despite the raciness of asynchronous transitions.
In response to the discussion in #197. Allows app code to mutate the history safely despite the raciness of asynchronous transitions.
|
The more I think about it the more I prefer @Zhuinden's fix for the original |
In response to the discussion in #197. Allows app code to mutate the history safely despite the raciness of asynchronous transitions.
|
Aaaand after sleeping on it, I'm 180° (360°?) back to thinking @edenman's original notion is the right one. It will lead to fewer cases where Sorry for all the noise, but it's my nature. |
|
Welp, I regularly check my notifications but apparently I skipped this one? Even though I was cc'd too... 😞
I ended up here because of #264 but I'm taking the comment over there. |
Fix for the issue #195.