A stack, but as an Rxjs Subject
A stack subject.
see: Subject https://rxjs-dev.firebaseapp.com/guide/subject
The type of item contained by the StackSubject.
Subject<T>
↳ StackSubject
Subscribable<T>SubscriptionLike⊕ new StackSubject(…items: T[]): StackSubject
Overrides Subject.__constructor
Defined in StackSubject.ts:20
Create a new observable, and eventually initialize it with some items.
Parameters:
| Name | Type | Description |
|---|---|---|
Rest items |
T[] |
The initial stack contained by the new StackSubject. |
Returns: StackSubject
getlength(): number
Defined in StackSubject.ts:18
Get the current number of items stacked in the observable.
Returns: number
getvalue(): undefined | T
Defined in StackSubject.ts:62
Retrieves the current value of the stack.
Returns: undefined | T
▸ _subscribe(subscriber: Subscriber<T>): Subscription
Overrides Subject._subscribe
Defined in StackSubject.ts:51
DO NOT USE. This is an internal implementation.
Parameters:
| Name | Type | Description |
|---|---|---|
| subscriber | Subscriber<T> |
The function to execute on new values. |
Returns: Subscription
▸ next(value?: T): void
Overrides Subject.next
Defined in StackSubject.ts:42
DP NOT USE. This method will throw an error to force you to use the push or pushEach methods.
deprecated: You should not use this class, in favor of push or pushEach
Parameters:
| Name | Type | Description |
|---|---|---|
Optional value |
T | Just don’t do it. |
Returns: void
▸ pop(count?: number): this
Defined in StackSubject.ts:103
Pop items from the stack, and emit new current value.
Parameters:
| Name | Type | Default value | Description |
|---|---|---|---|
Default value count |
number |
1 | The number of items to pop. |
Returns: this
▸ popEach(count?: number): this
Defined in StackSubject.ts:116
Pop items from the stack, and emit each popped value.
Parameters:
| Name | Type | Default value | Description |
|---|---|---|---|
Default value count |
number |
1 | The number of items to pop. |
Returns: this
▸ push(…items: T[]): this
Defined in StackSubject.ts:78
Append items to the stack, and emit the last value.
Parameters:
| Name | Type | Description |
|---|---|---|
Rest items |
T[] |
Items to add at the end of the stack. |
Returns: this
▸ pushEach(…items: T[]): this
Defined in StackSubject.ts:91
Append items to the stack, and emit each one of them
Parameters:
| Name | Type | Description |
|---|---|---|
Rest items |
T[] |
Items to add at the end of the stack. |
Returns: this