mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-23 23:12:04 +03:00
47 lines
913 B
Plaintext
47 lines
913 B
Plaintext
|
/+ default-agent, verb, dbug
|
||
|
::
|
||
|
=| state=~
|
||
|
%- agent:dbug
|
||
|
%+ verb &
|
||
|
^- agent:gall
|
||
|
|_ =bowl:gall
|
||
|
+* this .
|
||
|
def ~(. (default-agent this %|) bowl)
|
||
|
::
|
||
|
++ on-poke
|
||
|
|= [=mark =vase]
|
||
|
?+ mark !!
|
||
|
%leave [[%pass /sub %agent [our.bowl %pub] %leave ~]~ this]
|
||
|
%watch [[%pass /sub %agent [our.bowl %pub] %watch /foo]~ this]
|
||
|
==
|
||
|
::
|
||
|
++ on-watch
|
||
|
|= =path
|
||
|
(on-watch:def +<)
|
||
|
::
|
||
|
++ on-agent
|
||
|
|= [=wire =sign:agent:gall]
|
||
|
?. =(/foo wire)
|
||
|
~| wire+wire !!
|
||
|
~& sub+-.sign
|
||
|
?+ -.sign !!
|
||
|
%kick [[%pass /sub %agent [our.bowl %pub] %watch /foo]~ this]
|
||
|
%fact `this
|
||
|
%watch-ack `this
|
||
|
==
|
||
|
::
|
||
|
++ on-fail
|
||
|
|= [=term =tang]
|
||
|
(mean ':sub +on-fail' term tang)
|
||
|
::
|
||
|
++ on-leave
|
||
|
|= =path
|
||
|
`this
|
||
|
::
|
||
|
++ on-init ~& %sub-on-init `this
|
||
|
++ on-save !>(state)
|
||
|
++ on-load |=(old=vase `this(state !<(_state old)))
|
||
|
++ on-arvo on-arvo:def
|
||
|
++ on-peek on-peek:def
|
||
|
--
|