Skip to content

Instantly share code, notes, and snippets.

@persianturtle

persianturtle/app.re

Created Feb 13, 2018
Embed
What would you like to do?
Just the reducer field (solution 1)
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