Created
November 16, 2015 19:13
-
-
Save zerkalica/627565e603d51f4f1a17 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
import type {ReducerFn} from '../../../decorators' | |
import {generateReducer} from '../../../decorators' | |
class Action {} | |
class TodoAddMultipleAction extends Action {} | |
class TodoAddMultipleErrorAction extends Action {} | |
class TodoAddErrorAction extends Action {} | |
class TodoCompleteErrorAction extends Action {} | |
class TodoDestroyErrorAction extends Action {} | |
class A {} | |
class B {} | |
type AnyAction = Object & Action | |
class Example { | |
reduce(a: A, action: AnyAction, b: B): A { | |
return a | |
} | |
addMultiple(a: A, action: TodoAddMultipleAction, b: B): A { | |
return a | |
} | |
addError( | |
a: A, | |
{error}: TodoAddMultipleErrorAction | |
| TodoAddErrorAction | |
| TodoCompleteErrorAction | |
| TodoDestroyErrorAction, | |
b: B | |
): A { | |
return a | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment