open-index/open-npm huggingface dataset:
npm package: @ristostevcev/bs-callbag-of
Description: [![Build Status](https://travis-ci.org/Risto-Stevcev/bs-callbag-of.svg?branch=master)](https://travis-ci.org/Risto-Stevcev/bs-callbag-of) [![Latest release](https://img.shields.io/npm/v/@ristostevcev/bs-callbag-of.svg?style=flat)](https://www.npmjs.com/pa
Latest version: 0.1.0

# bs-callbag-of

[![Build Status](https://travis-ci.org/Risto-Stevcev/bs-callbag-of.svg?branch=master)](https://travis-ci.org/Risto-Stevcev/bs-callbag-of)
[![Latest release](https://img.shields.io/npm/v/@ristostevcev/bs-callbag-of.svg?style=flat)](https://www.npmjs.com/package/@ristostevcev/bs-callbag-of)
[![License](https://img.shields.io/npm/l/@ristostevcev/bs-callbag-of.svg?style=flat)](https://github.com/Risto-Stevcev/bs-callbag-of/blob/master/LICENSE)

Bucklescript wrapper for [callbag-of](https://github.com/Andarist/callbag-of)


# Install
```
yarn add @ristostevcev/bs-callbag-of
```

# Example

See [example](https://github.com/Risto-Stevcev/bs-callbag-of/blob/master/Example.ml)


# License
See [LICENSE](https://github.com/Risto-Stevcev/bs-callbag-of/blob/master/LICENSE)
npm package: @ristostevcev/bs-callbag-store
Description: A callbag implementation of a redux-like store
Author: Risto Stevcev
Latest version: 2.1.0

# bs-callbag-store

A callbag implementation of a redux-like store


## Install

```sh
npm i --save @ristostevcev/bs-callbag-store
```

## Usage

```ocaml
type state = { foobar: int }
type action = SetFoobar of int | Default

let { dispatch; store; get_state } = {foobar=1} |> make @@ fun state action ->
  match action with
  | SetFoobar foobar -> {foobar = state.foobar + foobar}
  | Default -> state

let _ =
  store
  |> scan (fun prev curr -> Js.Array.concat [|curr|] prev) [||]
  |> skip 2
  |> for_each Js.log;

  dispatch (SetFoobar 3);
  dispatch (SetFoobar 7);
  Js.log (get_state ())
```