This package has been deprecated

Author message:

deprecated

@reactive-js/observable-resource
TypeScript icon, indicating that this package has built-in type declarations

0.0.18 • Public • Published

@reactive-js/observable-resource

Utilities for creating, composing and transforming reactive-js Observable resources, eg Observable streams with lifecyle semantics, such as Subjects.

Installation

via npm

npm install @reactive-js/observable-resource

via yarn

yarn add @reactive-js/observable-resource

Usage

import { subscribe, createSubject } from "@reactive-js/rx";
import {
  exhaust,
  generate,
  map,
  onNext,
} from "@reactive-js/observable-resource";
import { pipe } from "@reactive-js/pipe";
import { createSchedulerWithPriority } from "@reactive-js/node";

const scheduler = createSchedulerWithPriority(500);
const subject = createSubject();

// Create a stateful observable resource which shares the subjects
// underly disposable. eg. disposing observableResource disposes
// subject as well.
const subscription = pipe(
  subject,
  map(x => fromArray([x, x, x, x])),
  exhaust(),
  onNext(console.log),
  subscribe(scheduler);
);

Documentation

API documentation is available here.

Package Sidebar

Install

npm i @reactive-js/observable-resource

Weekly Downloads

0

Version

0.0.18

License

MIT

Unpacked Size

507 kB

Total Files

22

Last publish

Collaborators

  • bordoley