rx-cancellable
Reactive Extensions - represents a state of cancellation
Platform | Build Status |
---|---|
Linux | |
Windows |
Install
NPM
npm i rx-cancellable
CDN
- jsDelivr
- unpkg
Usage
Loading the module
CommonJS
const Cancellable CANCELLED UNCANCELLED BooleanCancellable CompositeCancellable LinkedCancellable } = ;
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