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 pathom-remote [parser] | |
{:transmit! (fn transmit! [_ {::txn/keys [ast result-handler]}] | |
(let [edn (eql/ast->query ast) | |
ok-handler (fn [result] | |
(try | |
(result-handler (assoc result :status-code 200)) | |
(catch :default e | |
(js/console.error e "Result handler for remote failed with an exception.")))) | |
error-handler (fn [error-result] | |
(try |
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 cache-resolver [resolver] | |
(update resolver ::pc/resolve | |
(fn [resolve] | |
(fn [{::keys [persistent-cache*] :as env} input] | |
(let [cache-key [(::pc/sym resolver) input (p/params env)]] | |
(if-let [[_ v] (find @persistent-cache* cache-key)] | |
v | |
(let [response (resolve env input)] | |
(swap! persistent-cache* assoc cache-key response) | |
response))))))) |
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 your-ns | |
(:require [clojure.test.check.properties :as prop] | |
[com.wsscode.pathom.gen :as sgen] | |
[cljs.test :refer [is]] | |
[clojure.test.check.generators :as gen :include-macros true] | |
[fulcro.client.primitives :as fp] | |
[clojure.test.check :as tc] | |
[fulcro.client.mutations :as fm] | |
[clojure.data :as data])) |
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
/*! tether 1.4.4 */ | |
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.Tether = factory(); | |
} |
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
[{:com.wsscode.pathom.trace/event | |
:com.wsscode.pathom.parser/parse-loop, | |
:com.wsscode.pathom.trace/timestamp-leave 1535741953047, | |
:com.wsscode.pathom.trace/timestamp 1535741952740, | |
:com.wsscode.pathom.core/path [], | |
:com.wsscode.pathom.trace/relative-timestamp 0, | |
:com.wsscode.pathom.trace/duration 307} | |
{:key :fulcro.inspect.workspaces.ui.pathom-trace-cards/color, | |
:com.wsscode.pathom.trace/event | |
:com.wsscode.pathom.parser/process-key, |
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
(om/defui ^:once QueuedVideo | |
static uc/InitialAppState | |
(initial-state [_ title] {::video/id (random-uuid) | |
::video/title title}) | |
static om/IQuery | |
(query [_] [::video/id | |
::video/watched? | |
{::video/snippet | |
[::video/title |
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
(om/defui ^:once QueuedVideo | |
static uc/InitialAppState | |
(initial-state [_ title] {::video/id (random-uuid) | |
::video/title title}) | |
static om/IQuery | |
(query [_] [::video/id | |
::video/watched? | |
{::video/snippet | |
[::video/title |
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 ygq.background.main | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [cljs.core.async :as async :refer [<!]] | |
[chrome.rpc :as rpc] | |
[ygq.background.parser :as p] | |
[google.api :as g])) | |
(defonce comm-listener | |
(go | |
(let [rpc (rpc/listen (async/chan 10)) |
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 ygq.popup.core | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [untangled.client.core :as uc] | |
[cljs.core.async :as async :refer [<!]] | |
[chrome.rpc :as rpc] | |
[google.api :refer [get-auth-token]] | |
[untangled.client.network :as un])) | |
(defrecord Network [complete-app] | |
un/NetworkBehavior |
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 common-spec.coerce | |
(:refer-clojure :exclude [def]) | |
(:require [clojure.spec.alpha :as s] | |
[clojure.walk :as walk]) | |
(:import (java.util UUID))) | |
(s/def ::coerce-fn | |
(s/fspec :args (s/cat :x string?) :ret any?)) | |
(defonce ^:private registry-ref (atom {})) |
NewerOlder