Skip to content

Commit

Permalink
enjs for accs changed, naming updated
Browse files Browse the repository at this point in the history
  • Loading branch information
YunPearce committed Jan 10, 2024
1 parent 43418ff commit 11948c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
48 changes: 24 additions & 24 deletions desk/app/near-handler.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
=<
|_ =bowl:gall
+* this .
def ~(. (default-agent this %|) bowl)
eng ~(. +> [bowl ~])
def ~(. (default-agent this %|) bowl)
hc ~(. +> [bowl ~])
++ on-init
^- (quip card _this)
=^ cards state abet:init:eng
=^ cards state abet:init:hc
[cards this]
::
++ on-save
Expand All @@ -38,60 +38,60 @@
++ on-load
|= =vase
^- (quip card _this)
=^ cards state abet:(load:eng vase)
=^ cards state abet:(load:hc vase)
[cards this]
::
++ on-poke
|= [=mark =vase]
^- (quip card _this)
=^ cards state abet:(poke:eng mark vase)
=^ cards state abet:(poke:hc mark vase)
[cards this]
::
++ on-peek peek:eng
++ on-peek peek:hc
::
++ on-watch
|= =path
^- (quip card _this)
=^ cards state abet:(watch:eng path)
=^ cards state abet:(watch:hc path)
[cards this]
::
++ on-agent on-agent:def
++ on-arvo on-arvo:def
++ on-fail on-fail:def
++ on-leave on-leave:def
--
|_ [=bowl:gall dek=(list card)]
+* dat .
++ emit |=(=card dat(dek [card dek]))
++ emil |=(lac=(list card) dat(dek (welp lac dek)))
++ abet ^-((quip card _state) [(flop dek) state])
|_ [=bowl:gall deck=(list card)]
+* that .
++ emit |=(=card that(deck [card deck]))
++ emil |=(lac=(list card) that(deck (welp lac deck)))
++ abet ^-((quip card _state) [(flop deck) state])
::
++ from-self =(our src):bowl
::
++ init
^+ dat
dat
^+ that
that
::
++ load
|= vaz=vase
^+ dat
^+ that
?> ?=([%0 *] q.vaz)
dat(state !<(state-0 vaz))
that(state !<(state-0 vaz))
::
++ poke
|= [=mark =vase]
^+ dat
?+ mark dat
%action
^+ that
?+ mark that
%near-handler-action
?> from-self
=+ !<(act=action vase)
?- -.act
%add
=. accs (~(put in accs) +.act)
(emit give-accs)
give-accs
%del
=. accs (~(del in accs) +.act)
(emit give-accs)
give-accs
==
==
::
Expand All @@ -105,15 +105,15 @@
::
++ watch
|= =path
^+ dat
^+ that
?+ path ~|(bad-watch-path+path !!)
[%accs ~]
?> from-self
(emit give-accs)
give-accs
==
::
++ give-accs
^- card
%- emit
[%give %fact ~[/accs] %near-handler-update !>([%accs accs])]
::
--
5 changes: 3 additions & 2 deletions desk/lib/near-handler.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
|= accs=(set acc)
^- json
%: en-vase:etch
!> ^- (list acc)
~(tap in accs)
!> ^- (list @t)
%+ turn ~(tap in accs)
|=(=acc `@t`(scot %ux acc))
==
--
--

0 comments on commit 11948c9

Please sign in to comment.