@reactive-js/rx
Advanced tools
Comparing version 0.0.3 to 0.0.4
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var connect_1 = require("./internal/connect"); | ||
exports.connect = connect_1.connect; | ||
var createObservable_1 = require("./internal/createObservable"); | ||
exports.createObservable = createObservable_1.createObservable; | ||
var subject_1 = require("./internal/subject"); | ||
exports.createSubject = subject_1.createSubject; | ||
var delegatingSubscriber_1 = require("./internal/delegatingSubscriber"); | ||
exports.DelegatingSubscriber = delegatingSubscriber_1.DelegatingSubscriber; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,5 @@ | ||
export { connect } from "./internal/connect"; | ||
export { createObservable } from "./internal/createObservable"; | ||
export { createSubject } from "./internal/subject"; | ||
export { DelegatingSubscriber } from "./internal/delegatingSubscriber"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,22 +0,6 @@ | ||
import { DisposableLike } from "@reactive-js/disposable"; | ||
import { SchedulerResourceLike } from "@reactive-js/scheduler"; | ||
export interface ErrorLike { | ||
readonly cause: unknown; | ||
} | ||
export interface ObserverLike<T> { | ||
complete(error?: ErrorLike): void; | ||
next(data: T): void; | ||
} | ||
export interface SubscriberLike<T> extends ObserverLike<T>, DisposableLike, SchedulerResourceLike { | ||
readonly isConnected: boolean; | ||
} | ||
export interface ObservableLike<T> { | ||
subscribe(subscriber: SubscriberLike<T>): void; | ||
} | ||
export interface ObservableResourceLike<T> extends ObservableLike<T>, DisposableLike { | ||
} | ||
export interface SubjectLike<T> extends ObserverLike<T>, ObservableLike<T> { | ||
} | ||
export interface SubjectResourceLike<T> extends SubjectLike<T>, ObservableResourceLike<T> { | ||
} | ||
export { ErrorLike, ObserverLike, SubscriberLike, ObservableLike, ObservableResourceLike, SubjectLike, SubjectResourceLike, } from "./internal/interfaces"; | ||
export { connect } from "./internal/connect"; | ||
export { createObservable } from "./internal/createObservable"; | ||
export { createSubject } from "./internal/subject"; | ||
export { DelegatingSubscriber } from "./internal/delegatingSubscriber"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -27,2 +27,6 @@ [@reactive-js/rx](../README.md) › [SubscriberLike](subscriberlike.md) | ||
## Implemented by | ||
* [DelegatingSubscriber](../classes/delegatingsubscriber.md) | ||
## Index | ||
@@ -29,0 +33,0 @@ |
@@ -7,2 +7,6 @@ [@reactive-js/rx](README.md) | ||
### Classes | ||
* [DelegatingSubscriber](classes/delegatingsubscriber.md) | ||
### Interfaces | ||
@@ -17,1 +21,81 @@ | ||
* [SubscriberLike](interfaces/subscriberlike.md) | ||
### Functions | ||
* [connect](README.md#const-connect) | ||
* [createObservable](README.md#const-createobservable) | ||
* [createSubject](README.md#const-createsubject) | ||
## Functions | ||
### `Const` connect | ||
▸ **connect**<**T**>(`observable`: [ObservableLike](interfaces/observablelike.md)‹T›, `scheduler`: SchedulerLike): *DisposableLike* | ||
Safely connects an ObservableLike to a SubscriberLike, | ||
using the provided scheduler. The returned DisposableLike | ||
may used to cancel the subscription. | ||
**Type parameters:** | ||
▪ **T** | ||
**Parameters:** | ||
Name | Type | | ||
------ | ------ | | ||
`observable` | [ObservableLike](interfaces/observablelike.md)‹T› | | ||
`scheduler` | SchedulerLike | | ||
**Returns:** *DisposableLike* | ||
___ | ||
### `Const` createObservable | ||
▸ **createObservable**<**T**>(`onSubscribe`: function): *[ObservableLike](interfaces/observablelike.md)‹T›* | ||
Factory for safely creating new ObservableLikes. The onSubscribe function | ||
is called with an observer which may be notified from any context, | ||
queueing notifications for notification on the underlying SubscriberLike's | ||
scheduler. The onSubscribe function may return a DisposableOrTeardown instance | ||
which will be disposed when the underlying subscription is disposed. | ||
Note, implementations should not do significant blocking work in | ||
the onSubscribe function. | ||
**Type parameters:** | ||
▪ **T** | ||
**Parameters:** | ||
▪ **onSubscribe**: *function* | ||
▸ (`observer`: [ObserverLike](interfaces/observerlike.md)‹T›): *DisposableOrTeardown | void* | ||
**Parameters:** | ||
Name | Type | | ||
------ | ------ | | ||
`observer` | [ObserverLike](interfaces/observerlike.md)‹T› | | ||
**Returns:** *[ObservableLike](interfaces/observablelike.md)‹T›* | ||
___ | ||
### `Const` createSubject | ||
▸ **createSubject**<**T**>(`replayCount`: number): *[SubjectResourceLike](interfaces/subjectresourcelike.md)‹T›* | ||
**Type parameters:** | ||
▪ **T** | ||
**Parameters:** | ||
Name | Type | Default | | ||
------ | ------ | ------ | | ||
`replayCount` | number | 0 | | ||
**Returns:** *[SubjectResourceLike](interfaces/subjectresourcelike.md)‹T›* |
{ | ||
"name": "@reactive-js/rx", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "dist/cjs/index.js", | ||
@@ -20,4 +20,4 @@ "module": "dist/esm5/index.js", | ||
"dependencies": { | ||
"@reactive-js/disposable": "^0.0.3", | ||
"@reactive-js/scheduler": "^0.0.3", | ||
"@reactive-js/disposable": "^0.0.4", | ||
"@reactive-js/scheduler": "^0.0.4", | ||
"tslib": "^1.10.0" | ||
@@ -35,3 +35,3 @@ }, | ||
}, | ||
"gitHead": "c8b86e65e44ab3857d6242aaa29ea7716d842240" | ||
"gitHead": "482ada60e92db42bf0632396fcde4bc836585e8b" | ||
} |
@@ -1,68 +0,14 @@ | ||
import { DisposableLike } from "@reactive-js/disposable"; | ||
import { SchedulerResourceLike } from "@reactive-js/scheduler"; | ||
export { | ||
ErrorLike, | ||
ObserverLike, | ||
SubscriberLike, | ||
ObservableLike, | ||
ObservableResourceLike, | ||
SubjectLike, | ||
SubjectResourceLike, | ||
} from "./internal/interfaces"; | ||
/** | ||
* A wrapper around a caught error to handle wierd corner cases like | ||
* a function which throws undefined or a string. | ||
*/ | ||
export interface ErrorLike { | ||
readonly cause: unknown; | ||
} | ||
/** | ||
* An observer of push-based notifications. | ||
*/ | ||
export interface ObserverLike<T> { | ||
/** | ||
* Called by a provider to indicate that it is done sending push-based notifications. | ||
* | ||
* @param error If present, indicates that the provider experienced an error condition. | ||
*/ | ||
complete(error?: ErrorLike): void; | ||
/** | ||
* Provides the next item to observe. | ||
* | ||
* @param data | ||
*/ | ||
next(data: T): void; | ||
} | ||
/** | ||
* A SubscriberLike represents the underlying mechanism for receiving notifications from | ||
* an ObservableLike. A SubscriberLike composes an observer with a | ||
* scheduler and disposable subscription. Subscribers may only be notified | ||
* after they have been connected and must be notified from a SchedulerContinuation | ||
* executing on the subscriber's scheduler. Not doing so is a runtime error and will | ||
* result in errors being throw in DEV mode (these checks are disabled in production mode | ||
* for performance reasons). | ||
* | ||
* @noInheritDoc | ||
*/ | ||
export interface SubscriberLike<T> | ||
extends ObserverLike<T>, | ||
DisposableLike, | ||
SchedulerResourceLike { | ||
/** Returns true if the subscriber is connected. */ | ||
readonly isConnected: boolean; | ||
} | ||
/** | ||
* The source of notifications which may be observed by a SubscriberLike instance. | ||
*/ | ||
export interface ObservableLike<T> { | ||
subscribe(subscriber: SubscriberLike<T>): void; | ||
} | ||
/** @noInheritDoc */ | ||
export interface ObservableResourceLike<T> | ||
extends ObservableLike<T>, | ||
DisposableLike {} | ||
/** @noInheritDoc */ | ||
export interface SubjectLike<T> extends ObserverLike<T>, ObservableLike<T> {} | ||
/** @noInheritDoc */ | ||
export interface SubjectResourceLike<T> | ||
extends SubjectLike<T>, | ||
ObservableResourceLike<T> {} | ||
export { connect } from "./internal/connect"; | ||
export { createObservable } from "./internal/createObservable"; | ||
export { createSubject } from "./internal/subject"; | ||
export { DelegatingSubscriber } from "./internal/delegatingSubscriber"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71747
73
1183
4
1
+ Added@reactive-js/disposable@0.0.4(transitive)
+ Added@reactive-js/scheduler@0.0.4(transitive)
- Removed@reactive-js/disposable@0.0.3(transitive)
- Removed@reactive-js/scheduler@0.0.3(transitive)