EventsMapper

Last updated 9 months ago

A Function you provide to Redux Beacon to map actions to eventDefinitions.

Syntax

import {
eventForActionA,
eventForActionB,
eventForActionB2,
} from './event-definitions';
const eventsMapper = (action) => {
switch(action.type) {
case 'ACTION_A':
return eventForActionA;
case 'ACTION_B':
return [eventForActionB, eventForActionB2];
default:
return [];
};
}

Rules

Typescript Type

import { EventsMapper } from 'redux-beacon';

Usage