Method signature Subscribable.subscribe
Allows a callback to be added. This callback will be called whenever the value
is updated.
Signature
subscribe(callback: (value: T) => void): () => void;
Details
Parameters
Name |
Type |
Optional |
Description |
callback |
(value: T) => void |
No |
|
Returns
() => void
An unsubscribe function.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-02-04 UTC.
[null,null,["Last updated 2025-02-04 UTC."],[[["This functionality is available through the Google Workspace Developer Preview Program, offering early access to new features."],["A subscription callback can be implemented to monitor and respond to value updates."],["The `subscribe` method takes a mandatory callback function as a parameter, which is invoked when a value changes."],["The `subscribe` function returns an unsubscribe function, allowing the user to stop the subscription when they need to."]]],[]]