All Projects → Astrocoders → reason-epitath

Astrocoders / reason-epitath

Licence: MIT license
CPS sugar usage for React Render Props composition in ReasonML

Programming Languages

HTML
75241 projects
ocaml
1615 projects
C++
36643 projects - #6 most used programming language
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to reason-epitath

Bastet
A ReasonML/Ocaml library for category theory and abstract algebra
Stars: ✭ 200 (+1150%)
Mutual labels:  reasonml
Relude
FP-inspired prelude/standard library for ReasonML projects
Stars: ✭ 230 (+1337.5%)
Mutual labels:  reasonml
bs-spectacle
No description or website provided.
Stars: ✭ 15 (-6.25%)
Mutual labels:  reasonml
Luv
Cross-platform asynchronous I/O and system calls
Stars: ✭ 203 (+1168.75%)
Mutual labels:  reasonml
Lwt Node
Reason Implementation of Node.js API ✨🏎🚀✨
Stars: ✭ 226 (+1312.5%)
Mutual labels:  reasonml
Re Web
Experimental web framework for ReasonML & OCaml
Stars: ✭ 237 (+1381.25%)
Mutual labels:  reasonml
Bs Fetch
Fetch bindings for BuckleScript
Stars: ✭ 194 (+1112.5%)
Mutual labels:  reasonml
rr-2048
2048 game in Reason React
Stars: ✭ 15 (-6.25%)
Mutual labels:  reasonml
Wonder.js
🚀Functional, High performance 3D Webgl Engine
Stars: ✭ 225 (+1306.25%)
Mutual labels:  reasonml
granary
Tezos smart contract & dapp development toolkit
Stars: ✭ 67 (+318.75%)
Mutual labels:  reasonml
Bs Express
Express bindings in Reason
Stars: ✭ 207 (+1193.75%)
Mutual labels:  reasonml
Rescript Relay
Use Relay with ReasonML.
Stars: ✭ 214 (+1237.5%)
Mutual labels:  reasonml
Reason Graphql Fullstack
Fullstack Reason + GraphQL Todo List App
Stars: ✭ 246 (+1437.5%)
Mutual labels:  reasonml
Reason Urql
Reason bindings for Formidable's Universal React Query Library, urql.
Stars: ✭ 203 (+1168.75%)
Mutual labels:  reasonml
remotedata-re
Tools for fetching data from remote sources in Reason
Stars: ✭ 32 (+100%)
Mutual labels:  reasonml
Httpkit
⚡️ High-level, High-performance HTTP(S) Clients/Servers in Reason/OCaml
Stars: ✭ 198 (+1137.5%)
Mutual labels:  reasonml
Klipse
Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
Stars: ✭ 2,841 (+17656.25%)
Mutual labels:  reasonml
app-template-rescript-react
Adding ReScript with rescript-react on top of @snowpack/app-template-react
Stars: ✭ 44 (+175%)
Mutual labels:  reasonml
zestdb
ZestDB
Stars: ✭ 18 (+12.5%)
Mutual labels:  reasonml
bs-examples
some small examples showing how to use bucklescript/reason
Stars: ✭ 20 (+25%)
Mutual labels:  reasonml

bs-epitath demo

Read the article https://medium.com/astrocoders/render-props-composition-for-reasonml-is-here-b9c004ca9fcb

Running

npm install
npm start
module StateConfig = {
  type state = string;
};
/* ReContainers is from https://github.com/Astrocoders/recontainers/ */
module State = ReContainers.WithState.Make(StateConfig);

let component = ReasonReact.statelessComponent("App");

let make = _children => {
  ...component,
  render: _self => {
    let%Epitath emailState = children =>
      <State initialState=""> ...children </State>;

    <div>
      <h1> {ReasonReact.string("Meet Epitath")} </h1>
      <label> {ReasonReact.string("Email")} </label>
      <input
        onChange={
          event =>
            emailState.send(Set(ReactEvent.Form.target(event)##value))
        }
      />
      <p> {ReasonReact.string(emailState.state)} </p>
      {
        /* Combine as many as you want. Use even in the middle of JSX! */

        let%Epitath passwordState = children =>
          <State initialState=""> ...children </State>;

        <>
          <label> {ReasonReact.string("Password")} </label>
          <input
            onChange={
              event =>
                passwordState.send(
                  Set(ReactEvent.Form.target(event)##value),
                )
            }
          />
          <p> {ReasonReact.string(passwordState.state)} </p>
        </>;
      }
    </div>;
  },
};

Next Steps

Maybe change

let%Epitath passwordState = children =>
  <State initialState=""> ...children </State>;

to

let%Epitath passwordState = <State initialState="" />;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].