Experiment to setup a single step deploy process for Datomic Ions including setting up the AWS API Gateway.
Next experiment will be generating a CloudFormation template for the app.
Experiment to setup a single step deploy process for Datomic Ions including setting up the AWS API Gateway.
Next experiment will be generating a CloudFormation template for the app.
;; implementing a React component in pure cljs, no reagent necessary | |
;; using goog.object.extend to create a ES6 class that inherits from | |
;; React.Component | |
;; credit to @thheller | |
(defn MyReact [props context updater] | |
(this-as this | |
(js/React.Component.call this props context updater))) |
Without a persistent data store our React Native app would lose all state if killed and restarted.
React Native solves this by providing a simple storage system that is global to the app called AsyncStorage.
It is recommended that you use an abstraction on top of AsyncStorage like sunnylqm/react-native-storage but for now a few helper functions seem to suffice. Here's an alternative approach.
Without a persistent data store our app would lose all state if killed and restarted.
React Native solves this by providing a simple storage system that is global to the app called AsyncStorage. It is recommended that you use an abstraction on top of AsyncStorage so we use sunnylqm/react-native-storage.
We've introduced a dependency here. It's possible working directly with StorageAsync would have sufficed. See alternative approach.
I was struggling to compose datomic queries neatly. In the end I googled and found a blogpost which proposed a sane solution.
My motivation was an API endpoint with optional filters. I'd like my query include additional filters based on the args present.
Anyway, here's how my code ended up looking...
And the article: http://grishaev.me/en/datomic-query
(ns olivergeorge.schema | |
"generate datomic schema from simple spec forms" | |
(:require [clojure.spec.alpha :as s])) | |
(s/def ::schema-type | |
(s/or :db.type/string #{'string?} | |
:db.type/long #{'int? 'pos-int? 'neg-int? 'nat-int?} | |
:db.type/boolean #{'boolean?} | |
:db.type/float #{'float?} | |
:db.type/double #{'double?} |
(ns can-i-spy.dbg | |
(:require [clojure.spec.alpha :as s])) | |
(defonce dbg-meta (atom {})) | |
#?(:cljs (defonce dbg-data (atom {}))) | |
(defmacro spy | |
[k] | |
(let [symbols (keys (:locals &env)) |