rescript-js-map

    1.1.0 • Public • Published

    Rescript JS Map

    Rescript JS Map is a ReScript library that provides bindings to the JavaScript Map data type.

    Installation

    Using yarn or npm:

    yarn add rescript-js-map
    npm install --save rescript-js-map

    This package relies on the rescript-js-iterator package for Iterator bindings. In your bsconfig.json, add:

    {
      "bs-dependencies": ["rescript-js-map", "rescript-js-iterator"]
    }

    Usage

    module Map = Js_map
    let map = Map.make()
    
    let mutatedMap = map->Map.set("hello", "world")
    let isPhysicallyEqual = map === mutatedMap // true
    let hello = map->Map.get("hello") // Some("world")
    let hasHello = map->Map.has("hello") // true
    let foo = map->Map.get("bar") // None
    let size = map->Map.size // 1

    Contributing

    Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

    Please make sure to update tests as appropriate.

    License

    MIT

    Install

    npm i rescript-js-map

    DownloadsWeekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    5.66 kB

    Total Files

    5

    Last publish

    Collaborators

    • oliverfencott