This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-db | |
:contract/settings-loaded | |
interceptors | |
(fn [db [[max-name-length max-tweet-length]]] | |
(assoc db :settings {:max-name-length (.toNumber max-name-length) | |
:max-tweet-length (.toNumber max-tweet-length)}))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-fx | |
:blockchain/my-addresses-loaded | |
interceptors | |
(fn [{:keys [db]} [addresses]] | |
{:db (-> db | |
(assoc :my-addresses addresses) | |
(assoc-in [:new-tweet :address] (first addresses))) | |
:web3-fx.blockchain/balances | |
{:web3 (:web3 db/default-db) | |
:addresses addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(reg-event-fx | |
:new-tweet/send | |
interceptors | |
(fn [{:keys [db]} []] | |
(let [{:keys [name text address]} (:new-tweet db)] | |
{:web3-fx.contract/state-fn | |
{:instance (:instance (:contract db)) | |
:web3 (:web3 db) | |
:db-path [:contract :send-tweet] | |
:fn [:add-tweet name text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xbBC5eE8be95683983dF67260B0AB033c237Bde60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn partial-right | |
"Takes a function f and fewer than the normal arguments to f, and | |
returns a fn that takes a variable number of additional args. When | |
called, the returned function calls f with additional args + args." | |
([f] f) | |
([f arg1] | |
(fn [& args] (apply f (concat args [arg1])))) | |
([f arg1 arg2] | |
(fn [& args] (apply f (concat args [arg1 arg2])))) | |
([f arg1 arg2 arg3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns crmui-reagent.core | |
(:require | |
[cljsjs.material-ui] | |
[cljs-react-material-ui.core :as ui] | |
[cljs-react-material-ui.reagent :as rui] | |
[cljs-react-material-ui.icons :as ic] | |
[reagent.core :as r :refer [atom]] | |
[reagent.session :as session] | |
[secretary.core :as secretary :include-macros true] | |
[accountant.core :as accountant] |
OlderNewer