mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-17 11:51:32 +03:00
Refactored ++work's ++react to always supply the relevant action.
This commit is contained in:
parent
60f5ed19d1
commit
29cff5f815
@ -285,8 +285,8 @@
|
|||||||
++ react ::< new reaction
|
++ react ::< new reaction
|
||||||
::>
|
::>
|
||||||
::
|
::
|
||||||
|= rac/reaction
|
|= {res/?($info $fail) wat/cord}
|
||||||
(ta-delta %react red rac)
|
(ta-delta %react red [res wat `act])
|
||||||
::
|
::
|
||||||
++ affect ::< delta to story
|
++ affect ::< delta to story
|
||||||
::>
|
::>
|
||||||
@ -294,8 +294,7 @@
|
|||||||
|= {nom/knot dif/diff-story}
|
|= {nom/knot dif/diff-story}
|
||||||
?: (~(has by stories) nom)
|
?: (~(has by stories) nom)
|
||||||
(impact nom dif)
|
(impact nom dif)
|
||||||
%- react
|
(react %fail (crip "no story {(trip nom)}"))
|
||||||
[%fail (crip "no story {(trip nom)}") `act]
|
|
||||||
::
|
::
|
||||||
++ impact ::< delta for story
|
++ impact ::< delta for story
|
||||||
::>
|
::>
|
||||||
@ -319,8 +318,7 @@
|
|||||||
?. ?=(?($white $green) typ) ~
|
?. ?=(?($white $green) typ) ~
|
||||||
[our.bol ~ ~]
|
[our.bol ~ ~]
|
||||||
==
|
==
|
||||||
%- react
|
(react %fail (crip "{(trip nom)}: already exists"))
|
||||||
[%fail (crip "{(trip nom)}: already exists") `act]
|
|
||||||
::
|
::
|
||||||
++ action-delete ::< delete + announce
|
++ action-delete ::< delete + announce
|
||||||
::> delete story {nom}, optionally announcing the
|
::> delete story {nom}, optionally announcing the
|
||||||
@ -354,8 +352,7 @@
|
|||||||
|= {nom/knot inv/? sis/(set ship)}
|
|= {nom/knot inv/? sis/(set ship)}
|
||||||
=+ soy=(~(get by stories) nom)
|
=+ soy=(~(get by stories) nom)
|
||||||
?~ soy
|
?~ soy
|
||||||
%^ ta-delta %react red
|
(react %fail (crip "no story {(trip nom)}"))
|
||||||
[%fail (crip "no story {(trip nom)}") `act]
|
|
||||||
so-done:(~(so-permit so nom ~ u.soy) inv sis)
|
so-done:(~(so-permit so nom ~ u.soy) inv sis)
|
||||||
::
|
::
|
||||||
++ action-source ::< un/sub p to/from r
|
++ action-source ::< un/sub p to/from r
|
||||||
|
Loading…
Reference in New Issue
Block a user