core/snapshot
Utilities to facilitate integration with v8 snapshot builds
Members
Section titled “Members ”isWindowReady Function
Section titled “isWindowReady   Function ”isWindowReady( ) → BooleanDetermines if the window is available
0 Params
Returns
- Boolean
truewhenwindowis ready
onWindowReady Function
Section titled “onWindowReady   Function ”onWindowReady( callback ) → undefinedExecutes a callback, such as registering event handlers, when a valid window is available.
During normal operation, the callback will be executed immediately. During a pre-rendering pass, the callback is not be executed at all. When using snapshot, the callback is added to a queue and is executed in order once the window is available.
Important Notes
The callback should not alter the initial HTML state. If it does, it will invalidate the pre-render state and interfere with React rehydration.
The callback should be limited to module-scoped actions and not component instance actions. If the action is tied to a component, it should be invoked from within the component's lifecycle methods.
1 Param
- callback Function
Function to run when the window is ready
Returns
- undefined
windowReady Function
Section titled “windowReady   Function ”windowReady( ) → undefinedExecutes all queued window callbacks.
Requires that the window be, in fact, available and will throw an Error if not.
0 Params
Returns
- undefined