Replies: 1 comment 2 replies
-
Just my 2 cents: I was initially surprised as well that this callback is being called upon registration. Usually, I expect |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I had an issue that took me bit to figure out due to not realizing that onTransition will immediately call the listener. To work around, I am saving state outside my listener (and updating everytime the transition listener is called) and comparing the state sent to the listener with the "cached" state:
if (state === session.state) { return; }
It would be useful to be able to pass false to onTransition to prevent that initial call:
service.onTransition(onStateChange, false)
By default, it would work the same as now, but the extra parameter could specify whether the listener is called immediately. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions