Created
April 16, 2020 14:14
-
-
Save collinalexbell/7cd237c4e5ecddf3c950167977fc427d to your computer and use it in GitHub Desktop.
This file contains 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
type Handler = (state: TableState, action: Action) => TableState | |
function composeHandlers(handlers: Handler[]): Handler { | |
return handlers.reduceRight( | |
(composed: Handler, next: Handler) => | |
(state: TableState, action: Action): TableState => next(state, action)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment