UNPKG
@deepdub/react-arborist
Version:
latest (3.4.2)
3.4.2
3.4.1
react-arborist.netlify.app
brimdata/react-arborist
@deepdub/react-arborist
/
dist
/
module
/
state
/
edit-slice.js
14 lines
(13 loc)
•
302 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Actions */
export
function
edit
(
id
) {
return
{
type
:
"EDIT"
, id }; }
/* Reducer */
export
function
reducer
(
state = { id:
null
}, action
) {
if
(action.
type
===
"EDIT"
) {
return
Object
.
assign
(
Object
.
assign
({}, state), {
id
: action.
id
}); }
else
{
return
state; } }