Moved to
This file contains hidden or 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
(rf/reg-fx ::navigate (fn [a] (navigation/dispatch (navigation/navigate-action a)))) | |
(rf/reg-fx ::navigate2 (fn [[a b]] (navigation/navigate a b))) | |
(rf/reg-fx ::back (fn [] (navigation/dispatch (navigation/go-back-action)))) | |
(rf/reg-fx ::reset-stack-by-key (fn [m] (navigation/dispatch (navigation/reset-action m)))) | |
(rf/reg-fx ::pop (fn [n] (navigation/dispatch (navigation/pop-action n)))) | |
(rf/reg-fx ::pop-to-top #(navigation/dispatch (navigation/pop-to-top-action))) |
This file contains hidden or 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 canidatalogtocte | |
(:require [clojure.java.jdbc :as jdbc] | |
[clojure.string :as str] | |
[clojure.spec.alpha :as s] | |
[datascript.core :as d] | |
[clojure.test :refer [is]])) | |
(s/check-asserts true) | |
(def sqlite-db |
This file contains hidden or 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
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'verbose': { | |
'format': '%(levelname)s %(asctime)s %(module)s ' | |
'%(process)d %(thread)d %(message)s' | |
}, | |
}, |
Setup is based on clojurescript getting started guide. I've added a require statement to the core ns and using the latest master sha
deps.edn
{:deps {org.clojure/clojurescript {:git/url "https://github.com/clojure/clojurescript.git"
:sha "ec0fc33030ae1858a29c52f38e81fba4180d492b"}}}
src/hello_world/core.cljs
Based on: https://reactjs.org/docs/error-boundaries.html
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI instead of the component tree that crashed.
As of React 16, errors that were not caught by any error boundary will result in unmounting of the whole React component tree.
Reagent gives us access to the error boundary features
- Returning true from
:component-did-catch stops
the unmounting behaviour
This was close to useful but the SQL generated has problems with ORDER BY clauses.
The subquery was necessary to avoid GROUP BY problems.
class AG_DATES_OVERLAP(Func):
function = 'dbo.AG_DATES_OVERLAP'
template = "%(function)s(%(expressions)s)"
This file contains hidden or 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 app.test-runner | |
(:require [clojure.test :refer [deftest is run-tests]])) | |
(deftest is-this-working? | |
(is (= 1 2))) | |
(defmethod cljs.test/report [:cljs.test/default :end-run-tests] [m] | |
(when-not (cljs.test/successful? m) | |
(throw "Test failed"))) |
This file contains hidden or 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 v1 | |
(:require [clojure.test.check :as tc] | |
[clojure.test.check.generators :as gen] | |
[clojure.test.check.properties :as prop] | |
[clojure.spec.alpha :as s])) | |
(defn gen-char [n] | |
(gen/fmap #(apply str %) (gen/vector gen/char-alphanumeric n))) | |
(defn gen-varchar [n] |
This file contains hidden or 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
function XG(n, l, t) { | |
return Qa(fu([Sc, t])), | |
KG(l) || BG(n, l, pS) ? Array.isArray(t) || Nu(t) && !Mu(t) ? Tt.h(bu(t), 2) && BG(n, qt(t), $h) ? (Qa(fu([lw, "probably lookup ref", Wa.w(fu([new os(null, 5, ["vs", t, "(type vs)", Yn(t), "(count vs)", bu(t), "(first vs)", qt(t), "(is-attr? db (first vs) :db.unique/identity)", BG(n, qt(t), $h)], null)]))])), | |
new Ri(null, 1, 5, _i, [t], null)) : (Qa(fu([Lk])), | |
t) : (Qa(fu([xh, "not a collection at all, so definitely a single value", Wa.w(fu([new os(null, 6, ["vs", t, "(type vs)", Yn(t), "(arrays/array? vs)", Array.isArray(t), "(coll? vs)", Nu(t), "(vector? vs)", Hu(t), "(map? vs)", Mu(t)], null)]))])), | |
Qa(fu([Yo, "(satisfies? ICollection x)", null != t ? !!(8 & t.A || Rn === t.vg) || !t.A && Wn(ol, t) : Wn(ol, t)])), | |
new Ri(null, 1, 5, _i, [t], null)) : (Qa(fu([Fb, "not a multival context", new os(null, 4, ["a", l, "(type a)", Yn(l), "(reverse-ref? a)", KG(l), "(multival? db a)", BG(n, l, pS)], null)])), |