refactor state-handling in helper core
This commit is contained in:
parent
0c29772555
commit
2c99f59e97
@ -58,8 +58,10 @@
|
|||||||
`this
|
`this
|
||||||
%browsermanager-action
|
%browsermanager-action
|
||||||
=/ action !<(action:browsermanager vase)
|
=/ action !<(action:browsermanager vase)
|
||||||
=/ new-state state(access-counts (add 1 access-counts.state))
|
=/ output (handle-action action state)
|
||||||
[(handle-action action) this(state new-state)]
|
=/ new-actions=(list card) +2:output
|
||||||
|
=/ new-state=state-0 +3:output
|
||||||
|
[new-actions this(state new-state)]
|
||||||
==
|
==
|
||||||
++ on-save
|
++ on-save
|
||||||
~& 'on-save'
|
~& 'on-save'
|
||||||
@ -73,9 +75,10 @@
|
|||||||
--
|
--
|
||||||
:: Helper core
|
:: Helper core
|
||||||
++ handle-action
|
++ handle-action
|
||||||
|= action=action:browsermanager
|
|= [action=action:browsermanager state=state-0]
|
||||||
^- (list card)
|
^- [(list card) state-0]
|
||||||
~& 'Browser Manager action'
|
~& 'Browser Manager action'
|
||||||
~& >> action
|
~& >> action
|
||||||
~
|
=/ new-state state(access-counts (add 1 access-counts.state))
|
||||||
|
[~ new-state]
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user