Skip to content

glennsl/bs-immutablejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bs-immutablejs

Note: these are bindings to the Immutable.js library. These are only meant to be used to interoperate with existing JavaScript code; In OCaml/BuckleScript/Reason, we have more lightweight immutable (and optionally mutable) data structures by default (list, record, hashmap, set, and upcoming data structures).

Documentation

The source is a single file of BuckleScript externals. The API corresponds to Immutable.js' API.

Example usage:

let greeting = ImmutableJsRe.List.fromArray [|"hello", "world"|];

let extendedGreeting = ImmutableJsRe.List.push "how are you" greeting;

let reallyExtendedGreeting = ImmutableJsRe.List.(
  extendedGreeting
  |> push "I'm fine"
  |> push "thank you"
  |> push "and you?"
);

Generated code:

var greeting = Immutable.List(/* array */[
      "hello",
      "world"
    ]);
var extendedGreeting = greeting.push("how are you");
extendedGreeting.push("I'm fine").push("thank you").push("and you?");

Contributing

Prerequisite: https://github.com/reasonml/reason-cli.

git clone https://github.com/BuckleTypes/bs-immutablejs.git
cd bs-immutablejs
npm install
npm start

About

Reason + BuckleScript bindings to Immutable.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%