UNPKG
raid-addons
Version:
latest (4.1.0)
next (4.0.0)
4.1.0
4.0.0
3.5.0
3.4.1
3.4.0
3.3.3
3.3.1
3.0.2
3.0.0
2.13.0
2.11.0
2.10.1
2.10.0
2.9.0
2.8.0
2.7.0
2.5.0
2.4.0
2.3.0
2.2.0
2.2.0-rc
2.0.0
0.2.0
0.1.1
0.1.0
Add-ons functions for use with Raid
github.com/mattstyles/raid
mattstyles/raid
raid-addons
/
src
/
safe.js
12 lines
(8 loc)
•
177 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import { isDefined }
from
'./utils'
const
safe = fn => (state,
event
) => {
const
out
= fn(state,
event
)
return
isDefined(
out
) ?
out
: state } export
default
safe