Created
August 20, 2019 00:12
-
-
Save Rizary/5c2ec2732af9556edd3bf5dc94965bfa to your computer and use it in GitHub Desktop.
This file contains hidden or 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
_ <- mdo | |
historyState <- manageHistory $ HistoryCommand_PushState <$> setState | |
let | |
f (currentSet, currentHistoryState, oldRoute) idxChange = | |
let newRoute = switchPkgRoute currentSet oldRoute idxChange | |
in | |
HistoryStateUpdate | |
{ _historyStateUpdate_state = DOM.SerializedScriptValue jsNull | |
, _historyStateUpdate_title = "" | |
, _historyStateUpdate_uri = newRoute | |
} | |
setState = attachWith f ((\a b c -> (a,b,c)) <$> current dynReports | |
<*> current historyState | |
<*> current dynLoc ) evIdxChange | |
pure historyState |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment