Skip to content

Instantly share code, notes, and snippets.

@jeluard
Created October 17, 2018 08:21
Show Gist options
  • Save jeluard/797792ed829d64934b6ac8e61ff62992 to your computer and use it in GitHub Desktop.
Save jeluard/797792ed829d64934b6ac8e61ff62992 to your computer and use it in GitHub Desktop.
{meta {:name "DReddit"
:description "A set of commands to interract with DReddit"
:documentation ""}
events/list-tops
(let [{} properties]
[ethereum/logs {:on-result [store/put {:key :tops}]}])
views/dreddit-top
(let [{name :name vote :vote} properties]
[view
[text name]
[text "Vote counts: ${vote}"])
views/preview
(let [tops [store/get {:key :dreddit-tops}]]
[view {:style {:flex-direction :column
:align-items :flex-start}}
[list {:data tops :view dreddit-top}]])
hooks/commands.dreddit-tops
{:description "List top DReddit"
:scope #{:personal-chats}
:on-send [list-tops]
:preview [preview]
:short-preview [short-preview]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment