Last active
October 27, 2020 15:41
-
-
Save stenin-nikita/ea08040884c03eaa003dbb9fb3b3c5ee to your computer and use it in GitHub Desktop.
reatom-helpers
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 { Action } from '@reatom/core'; | |
export function isAction(arg: any): arg is Action<any> { | |
return arg && typeof arg === 'object' && typeof arg.type === 'string'; | |
} |
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 { PayloadActionCreator } from '@reatom/core'; | |
export function isActionCreator(arg: any): arg is PayloadActionCreator<any> { | |
return typeof arg === 'function' && typeof arg.getType === 'function'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment