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
type jssObj = { | |
. | |
"options": {. [@bs.set] "insertionPoint": Dom.element}, | |
}; | |
[@bs.module "jss"] external createJss : {.} => jssObj = "create"; | |
[@bs.module "material-ui/styles"] | |
external jssPreset : unit => {.} = "jssPreset"; |
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
[@bs.module "react-jss/lib/JssProvider"] | |
external myJssProvider : ReasonReact.reactClass = "default"; | |
let make = (~jss: InsertionPoint.jssObj, ~generateClassName: string, children)=> | |
ReasonReact.wrapJsForReason( | |
~reactClass=myJssProvider, | |
~props={ "jss": jss, "generateClassName": generateClassName}, | |
children, | |
); |
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
type breakpoint = [ | `lg | `md | `sm | `xl | `xs ]; | |
type breakpointsObj = { | |
. | |
"keys": array(string), | |
"values": { | |
. | |
"lg": int, | |
"md": int, | |
"sm": int, |
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
Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'} | |
Plug 'reasonml-editor/vim-reason-plus' | |
let g:LanguageClient_serverCommands = { | |
\ 'reason': ['ocaml-language-server', '--stdio'], | |
\ 'ocaml': ['ocaml-language-server', '--stdio'], | |
\ } | |
" Automatically start language servers. | |
let g:LanguageClient_autoStart = 1 |
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
(add-watch state-atom :watch | |
(fn [k | |
r | |
{was-open :is-open} | |
{:keys [is-open input-value]}] | |
(cond | |
(and | |
(not was-open) | |
is-open |
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
;; observe que funciona (ordem direita pra esquerda | |
;; (str (inc 2)) faz sentido né | |
((comp str inc) 2) | |
;; porque nao funciona | |
((comp inc str) 2) | |
;; rode este pro debaixo ser possível | |
(def options-map { | |
"3" {:code "3" :label "tres"} |
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
(def service-error-handler | |
(error-int/error-dispatch [ctx ex] | |
[({:exception-type :clojure.lang.ExceptionInfo} | |
:guard #(= (:type (ex-data (:exception %))) :guts.core/validation-failed)) | |
](do | |
(pprint (ex-data ex)) | |
(assoc ctx :response {:status 400 | |
:body (:errors (ex-data ex))})) | |
;; If we don't match, forward it on | |
:else |
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
(defn filter-options | |
[{:keys [options filter-fn value-key] :as props} filter-value exclude-options] | |
{:pre [(ifn? value-key) | |
(or (vector? exclude-options) (nil? exclude-options))]} | |
(let [exclude-options (if (vector? exclude-options) | |
(set exclude-options) | |
#{})] | |
(cond | |
(empty? filter-value) | |
options |
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
(defn get-in-link | |
"Wrapper around get-in for looking up for idents. if ks is nil it return the not-found value which is an empty map. That protects you from getting the entire state on a nested component." | |
([m ks] | |
(get-in-link m ks {})) | |
([m ks not-found] | |
(if (nil? ks) | |
not-found | |
(get-in m ks not-found)))) | |
(defmethod read :form-cliente |
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
(def init-data {:clientes [{:id 1 | |
:nome "geraldo" | |
:versao 0} | |
{:id 2 | |
:nome "luiz" | |
:versao 1}] | |
:form-cliente {:id 1 | |
:nome "geraldo" | |
:versao 0}}) |