Skip to content

Instantly share code, notes, and snippets.

@persianturtle

persianturtle/app.re

Created Feb 15, 2018
Embed
What would you like to do?
partial from reducer field
| TouchStart(clientX) =>
if (state.nav.isOpen) {
state.nav.isSwiping := true;
};
ReasonReact.Update({
...state,
nav: {
...state.nav,
position: [clientX]
}
});
| TouchMove(clientX) =>
if (state.nav.isSwiping^) {
ReasonReact.Update({
...state,
nav: {
...state.nav,
position: [clientX, ...state.nav.position]
}
});
} else {
ReasonReact.NoUpdate;
}
| TouchEnd(clientX) =>
state.nav.isSwiping := false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.