Created
November 28, 2017 06:10
-
-
Save drejohnson/bd372cd329bcc1a81be73537c0403de5 to your computer and use it in GitHub Desktop.
basic styletron bindings for reasonml
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 = | |
"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