Created
January 18, 2018 21:22
-
-
Save mattmarcello/335575974c2e8c9846dd93871ae15036 to your computer and use it in GitHub Desktop.
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
[@bs.send] external dispatchEvent : (Dom.window, Dom.event) => unit = ""; | |
[@bs.new] external makeEvent : ([@bs.string] [ | `popstate]) => Dom.event = "Event"; | |
let initializeRouter = () => | |
switch ([%external window]) { | |
| None => () | |
| Some(window: Dom.window) => dispatchEvent(window, makeEvent(`popstate)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment