UNPKG
@logux/actions
Version:
latest (0.5.0)
0.5.0
0.4.0
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0
Types and action creators for build-in Logux actions
logux.org
logux/actions
@logux/actions
/
define-action
/
index.js
11 lines
(10 loc)
•
223 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
function
defineAction
(type, creator)
{
if
(!creator) { creator = fields => {
return
{
type
, ...fields } } } creator.
type
=
type
creator.
match
= action => action.
type
===
type
return
creator }