We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9d968e0 + de72dfa commit 2cdebd5Copy full SHA for 2cdebd5
src/decoder/strategy/StateCallbacks.ts
@@ -94,8 +94,9 @@ export type CollectionCallback<K, V> = {
94
* If you want to listen to changes on individual items, you need to attach callbacks to the them directly inside the `onAdd` callback.
95
*
96
* @param callback
97
+ * @return callback to detach the onChange listener
98
*/
- onChange(callback: (item: V, index: K) => void): void;
99
+ onChange(callback: (item: V, index: K) => void): () => void;
100
};
101
102
type OnInstanceAvailableCallback = (callback: (ref: Ref, existing: boolean) => void) => void;
@@ -433,4 +434,4 @@ export function getDecoderStateCallbacks<T extends Schema>(decoder: Decoder<T>):
433
434
}
435
436
return $;
-}
437
+}
0 commit comments