WritableObservable<T>
Defined in: src/lib/observable/types.ts:118
Writable observable interface. Extends read-only with mutation capabilities.
Extends
Extended by
Type Parameters
| Type Parameter |
|---|
T |
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
id | readonly | string | The unique identifier of this observable. | ReadonlyObservable.id | src/lib/observable/types.ts:90 |
value | readonly | T | The current value. | ReadonlyObservable.value | src/lib/observable/types.ts:93 |
Methods
pipe()
pipe\<U\>(source: ReadonlyObservable\<U\>, transform?: (value: U) => T): Subscription;Defined in: src/lib/observable/types.ts:111
Subscribe to another observable, updating this one when it changes. Creates a one-way binding from source to this observable.
Type Parameters
| Type Parameter |
|---|
U |
Parameters
| Parameter | Type | Description |
|---|---|---|
source | ReadonlyObservable<U> | The source observable to subscribe to |
transform? | (value: U) => T | Optional transform function |
Returns
Subscription that can be disposed to unsubscribe
Inherited from
set()
set(value: T): void;Defined in: src/lib/observable/types.ts:125
Set a new value. Subscribers are notified if value changed.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | T | The new value |
Returns
void
subscribe()
subscribe(callback: SubscriptionCallback\<T\>): Subscription;Defined in: src/lib/observable/types.ts:101
Subscribe to value changes.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | SubscriptionCallback<T> | Function called when value changes |
Returns
Subscription that can be disposed to unsubscribe
Inherited from
update()
update(updater: (current: T) => T): void;Defined in: src/lib/observable/types.ts:132
Update the value using a function.
Parameters
| Parameter | Type | Description |
|---|---|---|
updater | (current: T) => T | Function that receives current value and returns new value |
Returns
void