Redux Beacon
Github
Search…
Introduction
Getting Started (Redux)
Getting Started (ngrx)
Examples & Recipes
Targets
API Reference
createMiddleware
createMetaReducer
EventDefinition
EventsMap
EventsMapper
Extensions
Utils
FAQ
Migration Guide (v1 to v2)
Notes on Offline Events
Powered By
GitBook
EventsMapper
A
Function
you provide to Redux Beacon to map actions to
eventDefinitions
.
Syntax
1
import
{
2
eventForActionA
,
3
eventForActionB
,
4
eventForActionB2
,
5
}
from
'./event-definitions'
;
6
7
const
eventsMapper
=
(
action
)
=>
{
8
switch
(
action
.
type
)
{
9
case
'ACTION_A'
:
10
return
eventForActionA
;
11
case
'ACTION_B'
:
12
return
[
eventForActionB
,
eventForActionB2
];
13
default
:
14
return
[];
15
};
16
}
Copied!
Rules
Each element in the returned array must be a valid
eventDefinition
.
Typescript Type
1
import
{
EventsMapper
}
from
'redux-beacon'
;
Copied!
Usage
Getting Started
Examples & Recipes
Previous
EventsMap
Next
Extensions
Last modified
4yr ago
Copy link
Contents
Syntax
Rules
Typescript Type
Usage