refactor state-handling in helper core

This commit is contained in:
ronreg-ribdev 2021-01-03 01:52:58 -08:00
parent 0c29772555
commit 2c99f59e97

View File

@ -58,8 +58,10 @@
`this
%browsermanager-action
=/ action !<(action:browsermanager vase)
=/ new-state state(access-counts (add 1 access-counts.state))
[(handle-action action) this(state new-state)]
=/ output (handle-action action state)
=/ new-actions=(list card) +2:output
=/ new-state=state-0 +3:output
[new-actions this(state new-state)]
==
++ on-save
~& 'on-save'
@ -73,9 +75,10 @@
--
:: Helper core
++ handle-action
|= action=action:browsermanager
^- (list card)
|= [action=action:browsermanager state=state-0]
^- [(list card) state-0]
~& 'Browser Manager action'
~& >> action
~
=/ new-state state(access-counts (add 1 access-counts.state))
[~ new-state]
--