document
* Warn if `document` is missing by the time invokeGuardedCallback runs in DEV * Typo * Add a comment * Use invariant() instead * Create event immediately for clarity