drop not needed UNLOAD_ACTION const

This commit is contained in:
nklhrstv 2020-03-28 11:13:09 +02:00
parent 33a0cee17e
commit ce0d0082ef

View file

@ -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(() => {