-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update context waits for start (#130)
- Loading branch information
Showing
2 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change seems to require us to now call
start()
prior to callingupdateContext()
. Our application (using package version2.1.0
) currently: 1) updates the content first (by callingupdateContext()
); and then 2) callsstart()
so that the newly-update context is used when the toggles are first retrieved. This approach works just fine prior this particular update in2.4.1
.Since both
updateContext()
andstart()
areasync
, we are awaiting each. The introduction of theawait new Promise(...)
in this function is causing our application to basically hang since this Promise can't be resolved (there's nothing to cause theEVENTS.READY
event to be emitted in that scenario).If the plan is to stick with this fix going forward, can the documentation be updated to indicate that this is a potentially-breaking change and provide guidelines on the proper order in calling these functions - particularly when you're initializing the UnleashClient???
Thanks!