The sqa-common JS library is a collection of utilities to support the clients of the SQA api.
It is provided as a node module published on the public npm registry.
Add the following dependency to package.json:
| (ns speed-test.core) | |
| (defn random-map | |
| "Generates a random map with provided depth and length" | |
| [opts] | |
| (let [{:keys [depth length random-key random-val] | |
| :or {depth 2 | |
| length 20 | |
| kfn #(rand-int 20) | |
| vfn #(rand-int 20)}} opts] |
| ... | |
| (def app-db (atom {:num 1})) | |
| (defnc SomeComponent [] | |
| (let [num (db/useSubscription [:db/get-in [:num]]) | |
| [rn/View [rn/Text (str num)]]) | |
| (defnc App [] | |
| [:provider {:context db/context | |
| :value app-db} |
| #!/usr/bin/python | |
| import curses, random, webbrowser | |
| screen = curses.initscr() | |
| width = screen.getmaxyx()[1] | |
| height = screen.getmaxyx()[0] | |
| size = width*height | |
| char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"] | |
| b = [] | |
| #!/usr/bin/python | |
| import curses, random | |
| screen = curses.initscr() | |
| width = screen.getmaxyx()[1] | |
| height = screen.getmaxyx()[0] | |
| size = width*height | |
| char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"] | |
| b = [] |
| (ns compound2.core3) | |
| (defprotocol Index | |
| :extend-via-metadata true | |
| (before [this o]) | |
| (after [this o]) | |
| (kfn [this o x]) | |
| (vfn [this o x]) | |
| (lookup [this o k] [this o k not-found]) | |
| (index [this o k v]) |
| (ns test.app | |
| (:require | |
| ["expo" :as ex] | |
| ["react-native" :as rn] | |
| ["react" :as react] | |
| [test.db :as db] | |
| [hx.react :as hx :refer [defnc]] | |
| [hx.hooks :as hooks] | |
| [shadow.expo :as expo])) |
| (ns query.core) | |
| (defn paths | |
| ([q] | |
| (paths [] {} q)) | |
| ([current-path m q] | |
| (letfn [(paths-map | |
| [current-path m q] | |
| (apply merge (for [[k v] q] | |
| (paths (conj current-path k) {} v)))) |
| {"paklausti" | |
| {:word/type :verb, | |
| :word/form-primary "paklausti", | |
| :word/forms | |
| (["paklausiu" "I ask"] | |
| ["paklausi" "you ask"] | |
| ["paklausia" "he/she asks"] | |
| ["paklausiame" "we ask"] | |
| ["paklausiate" "you all ask"] | |
| ["paklausia" "they ask"] |