Skip to content

Instantly share code, notes, and snippets.

@drejohnson
Created November 28, 2017 06:10
Show Gist options
  • Save drejohnson/bd372cd329bcc1a81be73537c0403de5 to your computer and use it in GitHub Desktop.
Save drejohnson/bd372cd329bcc1a81be73537c0403de5 to your computer and use it in GitHub Desktop.
basic styletron bindings for reasonml
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 =
"default";
module StyletronProvider = {
[@bs.module "styletron-react"] external styletronProvider : ReasonReact.reactClass =
"StyletronProvider";
let make = (~styletron, children) =>
ReasonReact.wrapJsForReason(
~reactClass=styletronProvider,
~props={"styletron": styletron},
children
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment