Utility function to generate event creators with specific type
Returns
an event creator with the form of (payload: T) => { type: string; payload: T }
NOTE: type will be attached to event creator to give access to it from function as property
Example
import { createEvent } from"reactive-actor";
// without payload exportconststartLoader = createEvent('START_LOADER');
// with payload exportconstgetUser = createEvent<{ name: string }>('GET_USER');
Utility function to generate event creators with specific type
Returns
an event creator with the form of
(payload: T) => { type: string; payload: T }
NOTE: type will be attached to event creator to give access to it from function as propertyExample