Fix startup race condition
Summary: Currently Flipper.init is called as soon as the script loads. However, if the store takes a bit longer than usual to get rehydrated, then this init call can get called before it has been set. Fixing it by using a specific event instead of the generic `onload`. Reviewed By: passy Differential Revision: D17711399 fbshipit-source-id: fcaf9e5943bfd15359038b8e3722f11d7e06379b
This commit is contained in:
committed by
Facebook Github Bot
parent
b3a98dc5e5
commit
957427d740
@@ -88,4 +88,5 @@ persistStore(store, undefined, () => {
|
||||
dispatcher(store, logger);
|
||||
// make init function callable from outside
|
||||
window.Flipper.init = init;
|
||||
window.dispatchEvent(new Event('flipper-store-ready'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user