rx-singleassignmentdisposable
The Reactive Extensions for JavaScript (RxJS) Single Assignment Subscription object.
Represents a subscription resource which only allows a single assignment of its underlying subscription resource. If an underlying subscription resource has already been set, future attempts to set the underlying subscription resource will throw an Error.
Documentation
SingleAssignment Subscription Members
SingleAssignmentSubscription.ctor
SingleAssignmentSubscription.prototype.subscription
SingleAssignmentSubscription.prototype.unsubscribe
SingleAssignmentSubscription
Creates a new instance of the SingleAssignmentSubscription class.
Example
var Subscription = ;var SingleAssignmentSubscription = ; // Create the instancevar subscription = ; // Set the subscriptionsusbcriptionsubscription = Subscriptionempty; // Unsubscribesubscription;
SingleAssignmentSubscription.prototype.subscription
Gets or sets the underlying subscription. After disposal, the result of getting this property is undefined. An error is thrown if the SingleAssignmentSubscription has already been assigned to.
Arguments
newValue
(Subscription): The new subscription value.
Returns
(Subscription): The underlying Subscription.
Example
var Subscription = ;var SingleAssignmentSubscription = ; // Create the instancevar subscription = ; // Set the subscriptionsusbcriptionsubscription = Subscriptionempty; // Get the subscriptionvar sub = subscriptionsubscription; // Unsubscribesubscription;
SingleAssignmentSubscription.prototype.unsubscribe()
Unsubscribes from the underlying subscription.
Example
var Subscription = ;var SingleAssignmentSubscription = ; // Create the instancevar subscription = ; // Set the subscriptionsusbcriptionsubscription = Subscriptionempty; // Get the subscriptionvar sub = subscriptionsubscription; // Unsubscribesubscription;
Installation
Using npm:
npm rx-singleassignmentdisposable
License
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.