Skip to content

An experimental state management library. Write Observables like you write React Hooks

License

Notifications You must be signed in to change notification settings

lxsmnsyc/riptide

Repository files navigation

riptide

An experimental state management library. Write Observables like you write React hooks.

Install

yarn

yarn add @lxsmnsyc/riptide

npm

npm install @lxsmnsyc/riptide

Example

import riptide from '@lxsmnsyc/riptide';

const counter = riptide.createColdRiptide(() => {
  const [state, setState] = riptide.useState(0);

  if (state > 10) {
    return riptide.complete();
  }

  setState(state + 1);

  return riptide.next(state);
});

counter.subscribe({
  next(value) {
    console.log(`Received: ${value}`);
  },
  error(value) {
    console.log(value);
  },
  complete() {
    console.log(`Counter completed!`);
  },
});

License

MIT © lxsmnsyc

About

An experimental state management library. Write Observables like you write React Hooks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published