Skip to content

Instantly share code, notes, and snippets.

@OliverJAsh
Created November 22, 2018 08:32
Show Gist options
  • Save OliverJAsh/d8e91bee9d4a17075d5a0c42eddc03eb to your computer and use it in GitHub Desktop.
Save OliverJAsh/d8e91bee9d4a17075d5a0c42eddc03eb to your computer and use it in GitHub Desktop.
// The `reducer` defines `transitions` for a given `state`
// and `event` (aka `action`) to the next `state`
const reducer = State.match({
FetchingDimensions: () =>
Action.match({
FetchedDimensions: ({ dimensions }) =>
checkDimensionsValid(dimensions)
? State.Uploading()
: State.Invalid()
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment