Skip to content

Instantly share code, notes, and snippets.

@Announcement
Created January 17, 2020 18:46
Show Gist options
  • Save Announcement/aabe15be9ed3f9f1c170cc389718dba2 to your computer and use it in GitHub Desktop.
Save Announcement/aabe15be9ed3f9f1c170cc389718dba2 to your computer and use it in GitHub Desktop.
unexpected token @ row: 2, column: 78
// @flow
function _createReducer<T, K>(handler: { [$PropertyType<K, 'type'>]: ({ action, state }: { action: K, state: T }) => T }): (state: T, action: K) => T {
if (handler.hasOwnProperty(action.type))
return handler[action.type]({
action,
state
});
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment