Podpis metody Subscribable.subscribe
Umożliwia dodanie połączenia zwrotnego. To wywołanie zwrotne jest wywoływane po każdej zmianie wartości.
Podpis
subscribe(callback: (value: T) => void): () => void;
Szczegóły
Parametry
Nazwa |
Typ |
Opcjonalny |
Opis |
callback |
(value: T) => void |
Nie |
|
Zwroty
() => void
Funkcja anulowania subskrypcji.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-02-04 UTC.
[null,null,["Ostatnia aktualizacja: 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."]]],[]]