From ce0d0082efbb5fdbce02bc3d1615d2390e75c356 Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Sat, 28 Mar 2020 11:13:09 +0200 Subject: [PATCH] drop not needed UNLOAD_ACTION const --- src/common/useModelState.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/useModelState.js b/src/common/useModelState.js index 277b1c943..106637657 100644 --- a/src/common/useModelState.js +++ b/src/common/useModelState.js @@ -4,10 +4,6 @@ const { useRouteFocused } = require('stremio-router'); const { useServices } = require('stremio/services'); const useDeepEqualState = require('stremio/common/useDeepEqualState'); -const UNLOAD_ACTION = { - action: 'Unload', -}; - const useModelState = ({ model, init, action, timeout, onNewState, map, mapWithCtx }) => { const modelRef = React.useRef(model); const mountedRef = React.useRef(false); @@ -19,7 +15,7 @@ const useModelState = ({ model, init, action, timeout, onNewState, map, mapWithC }, [action]); React.useLayoutEffect(() => { return () => { - core.dispatch(UNLOAD_ACTION, modelRef.current); + core.dispatch({ action: 'Unload' }, modelRef.current); }; }, []); React.useLayoutEffect(() => {