Skip to content

Instantly share code, notes, and snippets.

@stenin-nikita
Last active October 27, 2020 15:41
Show Gist options
  • Save stenin-nikita/ea08040884c03eaa003dbb9fb3b3c5ee to your computer and use it in GitHub Desktop.
Save stenin-nikita/ea08040884c03eaa003dbb9fb3b3c5ee to your computer and use it in GitHub Desktop.
reatom-helpers
import { Action } from '@reatom/core';
export function isAction(arg: any): arg is Action<any> {
return arg && typeof arg === 'object' && typeof arg.type === 'string';
}
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