All the docs probably
base..
.> view base..
(base..) : (b ->{𝕖} c) -> (a ->{𝕖} b) -> a ->{𝕖} c
(base..) f g x = f (g x)
module StringContext = | |
Context.MakePair({ | |
type t = string; | |
let defaultValue = "Awesome"; | |
}); | |
let component = ReasonReact.statelessComponent("Tree"); | |
let make = _children => { |
(defn code-mirror | |
"Create a code-mirror editor. The parameters: | |
value-atom (reagent atom) | |
when this changes, the editor will update to reflect it. | |
options | |
:style (reagent style map) | |
will be applied to the container element | |
:js-cm-opts | |
options passed into the CodeMirror constructor | |
:on-cm-init (fn [cm] -> nil) |
.> view base..
(base..) : (b ->{𝕖} c) -> (a ->{𝕖} b) -> a ->{𝕖} c
(base..) f g x = f (g x)
let recv = (client, maxlen) => { | |
let bytes = Bytes.create(maxlen); | |
let len = Unix.recv(client, bytes, 0, maxlen, []); | |
Bytes.sub_string(bytes, 0, len) | |
}; | |
let parse_top = top => { | |
let parts = Str.split(Str.regexp("[ \t]+"), top); | |
switch (parts) { |
// Reason Macros! | |
// Use templates to write your code for you. | |
let%macro add5 = (input: ident, log: string) => { | |
if%eval (env("node_environment") != "production") { | |
Js.log(eval__input) | |
}; | |
eval__input + 5 | |
}; |
let module Styled = { | |
let module Create (Config: { | |
let name: string; | |
let style: ReactNative.Style.style; | |
}) => { | |
let component = ReasonReact.statelessComponent Config.name; | |
let make ::paddingVertical=? => { | |
let style = combineStylesSomeHow Config.style paddingVertical; /* <- this is an optional btw */ | |
View.make ::style |
CAMLprim value fluid_create_ScrollView(value dims_v) { | |
CAMLparam1(dims_v); | |
CAMLlocal1(view_v); | |
log("Create scroll view\n"); | |
Unpack_record4_double(dims_v, left, top, width, height); | |
NSRect frame = NSMakeRect(left, top, width, height); | |
NSScrollView* view = [[NSScrollView alloc] initWithFrame:frame]; |
Part 2 | |
- run a server with "npx http-server -p 3000 -c-1", and open `http://localhost:3000/src/simple` in your browser | |
- https://github.com/apollographql/reason-apollo -- follow the setup instructions | |
- the "apollo http link" url should be "https://serve.onegraph.com/dynamic?app_id=0b33e830-7cde-4b90-ad7e-2a39c57c0e11" | |
- get the query from discord | |
Goal 2: run the query, and render the `response##rss##rss2Feed##title` to the page. |
WIFI: MSFTGuest -- on the login website, use the "Access code": msevent394hr | |
go to discord.gg/reasonml | |
the instructions are in the #reason-dojo channel | |
Goal: Make a podcast app, using the GraphQL query that's in the channel. | |
If you have questions, raise your hand! | |
Also feel free to ask things in the #reason-dojo channel | |
- clone https://github.com/reasonml-community/reason-react-example |