Tanda tangan metode Subscribable.subscribe
Mengizinkan callback ditambahkan. Callback ini akan dipanggil setiap kali nilai
diperbarui.
Tanda Tangan
subscribe(callback: (value: T) => void): () => void;
Detail
Parameter
Nama |
Jenis |
Opsional |
Deskripsi |
callback |
(value: T) => void |
Tidak |
|
Hasil
() => void
Fungsi berhenti berlangganan.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-02-04 UTC.
[null,null,["Terakhir diperbarui pada 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."]]],[]]