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 t; | |
[@bs.obj] | |
external renderer_options : | |
( | |
~plugins: array(t)=?, | |
~enhancers: array(t)=?, | |
~mediaQueryOrder: array(string)=?, | |
~supportQueryOrder: array(string)=?, | |
~selectorPrefix: string=?, |
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 t; | |
type getStylesheetsHtmlMeth = {. "getStylesheetsHtml": [@bs.meth] (unit => unit)}; | |
[@bs.val] external styletron_client_option : array(string) => t = ""; | |
[@bs.module "styletron-client"] [@bs.new] external styletronClient : 'a => 'a = "default"; | |
[@bs.module "styletron-server"] [@bs.new] | |
external styletronServer : unit => getStylesheetsHtmlMeth = |
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
let unitConfig = Fela.Plugins.unit_config(~unit_="rem", ()); | |
let extendPlugin = Fela.Plugins.extend; | |
let embeddedPlugin = Fela.Plugins.embedded; | |
let prefixerPlugin = Fela.Plugins.prefixer; | |
let fallbackValue = Fela.Plugins.fallbackValue; |
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
module Moment = { | |
type t; | |
[@bs.send.pipe : t] external format : string => string = ""; | |
[@bs.send.pipe : t] external utcOffset : string => t = ""; | |
}; | |
[@bs.module] external _moment : string => Moment.t = "moment"; | |
let moment = (value) => _moment(value); |
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 selection = { | |
. | |
"alias": string, | |
"arguments": Js.Array.t(string), | |
"directives": Js.Array.t(string), | |
"kind": string, | |
"name": { | |
. | |
"kind": string, | |
"value": string |
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 hoc = ReasonReact.reactClass => ReasonReact.reactClass; | |
[@bs.module "react-apollo"] external graphql : GraphQLTag.definitions => hoc = "graphql"; | |
module type Query = {type data; let query: GraphQLTag.definitions;}; | |
module CreateWrapper = (Query: Query) => { | |
type props = {. "data": Query.data}; | |
let wrapComponent = (~component, ~make) => { | |
let jsComponent = |
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 "aws-appsync"] [@bs.new] | |
external makeAWSAppSyncClient : | |
{ | |
. | |
"url": Js.Nullable.t(string), | |
"region": Js.Nullable.t(string), | |
"auth": | |
Js.Nullable.t( | |
{ | |
. |
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
// FP Lenses | |
const lens = get => set => ({ get, set }); | |
const view = lens => obj => lens.get(obj); | |
const set = lens => val => obj => lens.set(val)(obj); | |
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj); | |
const lensProp = key => lens(prop(key))(assoc(key)); |
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() { | |
var emitter = { | |
emit: console.dir.bind(console) | |
} | |
function emit(mutation) { | |
var target = mutation.target | |
var name = mutation.attributeName | |
var value = target.getAttribute(name) |
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
-- Somewhere in you Elm app you can add editor by adding an empty node with the correct attributes. | |
-- The JS library will be initialized and destroyed automatically! | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ div | |
[ attribute "data-ace" "" | |
, attribute "data-ace-theme" "monokai" | |
, attribute "data-ace-mode" "javascript" |