Git Product home page Git Product logo

rx-cancellable's Introduction

rx-cancellable

Reactive Extensions - represents a state of cancellation

NPM

HitCount

Platform Build Status
Linux Build Status
Windows Build status

codecov Known Vulnerabilities

Install

NPM

npm i rx-cancellable

CDN

  • jsDelivr
<script src="https://cdn.jsdelivr.net/npm/rx-cancellable/dist/index.min.js"></script>
  • unpkg
<script src="https://unpkg.com/rx-cancellable/dist/index.min.js"></script>

Usage

Loading the module

CommonJS

const {
  Cancellable,
  CANCELLED,
  UNCANCELLED,
  BooleanCancellable,
  CompositeCancellable,
  LinkedCancellable
} = require('rx-cancellable');

Browser

Loading the JavaScript file for the rx-cancellable the classes:

  • Cancellable
  • CANCELLED,
  • UNCANCELLED,
  • BooleanCancellable,
  • CompositeCancellable,
  • LinkedCancellable

Types

There are 3 types of Cancellables provided:

Type Description
BooleanCancellable Basic implementation of a Cancellable that represents a boolean state.
CompositeCancellable An implementation of a Cancellable that allows composition of multiple Cancellable instances into a single Cancellable instance.
LinkedCancellable A Cancellable whose state relies upon another Cancellable. If a LinkedCancellable has no link, it is treated as a BooleanCancellable.

And provides 2 Singleton instance:

Type Description
CANCELLED A Cancellable instance that is always cancelled.
UNCANCELLED A Cancellable instance that is always uncancelled.

Documentation

You can read the documentation at the official doc site

Build

Clone the repo first, then run the following to install the dependencies

npm install

To build the coverages, run the test suite, the docs, and the distributable modules:

npm run build

Changelogs

0.3.2

  • Fixed CompositeCancellable not dispatching event listeners when cancelled. 0.3.0
  • Removed privacy of cancellable states. The decision of replacement is due to performance issues with WeakMaps. 0.2.0
  • Introduces 3 Cancellable classes instead of a tree-structured Cancellable.
  • Introduces 2 singleton instances of Cancellable 0.1.0
  • Release

rx-cancellable's People

Contributors

dependabot[bot] avatar lxsmnsyc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.