Created
February 13, 2018 03:13
-
-
Save persianturtle/08a47f58327c9fdbaa0218674a2fa270 to your computer and use it in GitHub Desktop.
Just the reducer field (solution 1)
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
reducer: (action, state) => | |
switch action { | |
| Navigate(_routeWithTitle) => ReasonReact.NoUpdate | |
| ToggleMenu(isOpen) => | |
ReasonReact.UpdateWithSideEffects( | |
{ | |
...state, | |
nav: { | |
isOpen: isOpen | |
} | |
}, | |
( | |
_self => | |
if (isOpen) { | |
[%bs.raw | |
{| document.documentElement.style.overflow = "hidden"|} | |
]; | |
} else { | |
[%bs.raw {| document.documentElement.style.overflow = ""|}]; | |
} | |
) | |
) | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment