vastlint-react 0.4.21 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks.js +6 -0
- package/package.json +3 -3
package/dist/hooks.js
CHANGED
|
@@ -230,8 +230,10 @@ export function useVastPlayback(options) {
|
|
|
230
230
|
const { autoInitialize = true, ...controllerOptions } = options;
|
|
231
231
|
const trackedPlaybackRef = useRef(null);
|
|
232
232
|
const autoInitializedControllersRef = useRef(new WeakSet());
|
|
233
|
+
const disposedControllersRef = useRef(new WeakSet());
|
|
233
234
|
const playbackConfig = createPlaybackConfig(controllerOptions);
|
|
234
235
|
if (!trackedPlaybackRef.current
|
|
236
|
+
|| disposedControllersRef.current.has(trackedPlaybackRef.current.controller)
|
|
235
237
|
|| hasPlaybackConfigChanged(trackedPlaybackRef.current.config, playbackConfig)) {
|
|
236
238
|
trackedPlaybackRef.current = {
|
|
237
239
|
config: playbackConfig,
|
|
@@ -243,6 +245,7 @@ export function useVastPlayback(options) {
|
|
|
243
245
|
const snapshot = useSubscribedSnapshot(controller);
|
|
244
246
|
useEffect(() => {
|
|
245
247
|
return () => {
|
|
248
|
+
disposedControllersRef.current.add(controller);
|
|
246
249
|
controller.dispose();
|
|
247
250
|
};
|
|
248
251
|
}, [controller]);
|
|
@@ -300,8 +303,10 @@ export function useVastPlaybackQueue(options) {
|
|
|
300
303
|
const { autoInitialize = true, ...controllerOptions } = options;
|
|
301
304
|
const trackedPlaybackQueueRef = useRef(null);
|
|
302
305
|
const autoInitializedControllersRef = useRef(new WeakSet());
|
|
306
|
+
const disposedControllersRef = useRef(new WeakSet());
|
|
303
307
|
const playbackQueueConfig = createPlaybackQueueConfig(controllerOptions);
|
|
304
308
|
if (!trackedPlaybackQueueRef.current
|
|
309
|
+
|| disposedControllersRef.current.has(trackedPlaybackQueueRef.current.controller)
|
|
305
310
|
|| hasPlaybackQueueConfigChanged(trackedPlaybackQueueRef.current.config, playbackQueueConfig)) {
|
|
306
311
|
trackedPlaybackQueueRef.current = {
|
|
307
312
|
config: playbackQueueConfig,
|
|
@@ -313,6 +318,7 @@ export function useVastPlaybackQueue(options) {
|
|
|
313
318
|
const snapshot = useSubscribedSnapshot(controller);
|
|
314
319
|
useEffect(() => {
|
|
315
320
|
return () => {
|
|
321
|
+
disposedControllersRef.current.add(controller);
|
|
316
322
|
controller.dispose();
|
|
317
323
|
};
|
|
318
324
|
}, [controller]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vastlint-react",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "Headless React hooks for
|
|
3
|
+
"version": "0.4.23",
|
|
4
|
+
"description": "Headless React hooks for the VASTlint client runtime.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Alex Sekowski <alex@vastlint.org>",
|
|
7
7
|
"homepage": "https://vastlint.org",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"vastlint-client": "^0.4.
|
|
52
|
+
"vastlint-client": "^0.4.23"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"react": ">=18"
|