Reactive Extensions - represents a state of cancellation
Platform | Build Status |
---|---|
Linux | |
Windows |
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>
const {
Cancellable,
CANCELLED,
UNCANCELLED,
BooleanCancellable,
CompositeCancellable,
LinkedCancellable
} = require('rx-cancellable');
Loading the JavaScript file for the rx-cancellable the classes:
- Cancellable
- CANCELLED,
- UNCANCELLED,
- BooleanCancellable,
- CompositeCancellable,
- LinkedCancellable
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. |
You can read the documentation at the official doc site
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
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