md-hooks: upgrade for versioning

This commit is contained in:
Liam Fitzgerald 2021-03-11 14:05:50 +10:00
parent 4b305b5450
commit 37ab1b7b2a
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
7 changed files with 27 additions and 10 deletions

View File

@ -227,7 +227,7 @@
::
++ groups-fact
|= =cage
?. ?=(%group-update p.cage) jn-core
?. ?=(%group-update-0 p.cage) jn-core
=+ !<(=update:group-store q.cage)
?. ?=(%initial-group -.update) jn-core
?. =(rid resource.update) jn-core
@ -246,7 +246,7 @@
::
++ md-fact
|= [=mark =vase]
?. ?=(%metadata-update mark) jn-core
?. ?=(%metadata-update-0 mark) jn-core
=+ !<(=update:metadata vase)
?. ?=(%initial-group -.update) jn-core
?. =(group.update rid) jn-core

View File

@ -113,7 +113,7 @@
(group-update !<(update:group-store q.cage.sign))
[cards this]
::
%metadata-update
%metadata-update-0
=^ cards state
(metadata-update !<(update:metadata q.cage.sign))
[cards this]

View File

@ -15,6 +15,7 @@
update:metadata
%metadata-update
%metadata-push-hook
0 0
%.n
==
+$ state-zero
@ -151,7 +152,7 @@
%kick [watch-store^~ state]
::
%fact
?> ?=(%metadata-update p.cage.sign)
?> ?=(%metadata-update-0 p.cage.sign)
=+ !<(=update:metadata q.cage.sign)
?. ?=(%initial-group -.update) `state
`state(previews (~(del by previews) group.update))
@ -255,7 +256,7 @@
%+ turn ~(tap by associations)
|= [=md-resource:metadata =association:metadata]
%+ poke-our:pass:io %metadata-store
:- %metadata-update
:- %metadata-update-0
!> ^- update:metadata
[%remove resource md-resource]
::

View File

@ -14,6 +14,7 @@
update:store
%metadata-update
%metadata-pull-hook
0 0
==
::
+$ agent (push-hook:push-hook config)

View File

@ -126,7 +126,7 @@
?> (team:title our.bowl src.bowl)
=^ cards state
?+ mark (on-poke:def mark vase)
?(%metadata-action %metadata-update)
?(%metadata-action %metadata-update-0)
(poke-metadata-update:mc !<(update:store vase))
::
%import
@ -144,7 +144,7 @@
=/ cards=(list card)
?+ path (on-watch:def path)
[%all ~]
(give %metadata-update !>([%associations associations]))
(give %metadata-update-0 !>([%associations associations]))
::
[%updates ~]
~
@ -152,7 +152,7 @@
[%app-name @ ~]
=/ =app-name:store i.t.path
=/ app-indices (metadata-for-app:mc app-name)
(give %metadata-update !>([%associations app-indices]))
(give %metadata-update-0 !>([%associations app-indices]))
==
[cards this]
::
@ -443,6 +443,6 @@
++ update-subscribers
|= [pax=path =update:store]
^- (list card)
[%give %fact ~[pax] %metadata-update !>(update)]~
[%give %fact ~[pax] %metadata-update-0 !>(update)]~
--
--

View File

@ -0,0 +1,15 @@
/+ store=metadata-store
|_ =update:store
++ grad %noun
++ grow
|%
++ noun update
++ json (update:enjs:store update)
--
::
++ grab
|%
++ noun update:store
++ json action:dejs:store
--
--

View File

@ -41,7 +41,7 @@
(poke-our %graph-push-hook %push-hook-action !>([%remove rid]))
;< ~ bind:m
%+ poke-our %metadata-push-hook
:- %metadata-update
:- %metadata-update-0
!> ^- action:metadata
[%remove group-rid [%graph rid]]
(pure:m ~)