mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 23:47:35 +03:00
5f4fc28bc9
Improved the namespacing by dropping the app prefix on types, e.g. chat-hook-action -> action. Compensated for shadowing by importing the /sur files behind a face. End result is that a chat-hook-action becomes an action:hook. Splits chat-json into lib/chat-{hook,store,view}. Uses ^? on changes files in /lib and /sur to discourage deeply nested importing.
50 lines
783 B
Plaintext
50 lines
783 B
Plaintext
/- *chat-hook
|
|
^?
|
|
|%
|
|
::
|
|
++ enjs
|
|
|%
|
|
++ update
|
|
|= upd=^update
|
|
=, enjs:format
|
|
^- json
|
|
%+ frond %chat-hook-update
|
|
%- pairs
|
|
%+ turn ~(tap by synced.upd)
|
|
|= [pax=^path shp=^ship]
|
|
^- [cord json]
|
|
[(spat pax) s+(scot %p shp)]
|
|
--
|
|
++ dejs
|
|
|%
|
|
::
|
|
++ action
|
|
|= jon=json
|
|
^- ^action
|
|
=, dejs:format
|
|
=< (parse-json jon)
|
|
|%
|
|
::
|
|
++ parse-json
|
|
%- of
|
|
:~ [%add-owned add-owned]
|
|
[%add-synced add-synced]
|
|
[%remove pa]
|
|
==
|
|
::
|
|
++ add-owned
|
|
%- ot
|
|
:~ [%path pa]
|
|
[%allow-history bo]
|
|
==
|
|
::
|
|
++ add-synced
|
|
%- ot
|
|
:~ [%ship (su ;~(pfix sig fed:ag))]
|
|
[%path pa]
|
|
[%ask-history bo]
|
|
==
|
|
--
|
|
--
|
|
--
|