mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
drop not needed UNLOAD_ACTION const
This commit is contained in:
parent
33a0cee17e
commit
ce0d0082ef
1 changed files with 1 additions and 5 deletions
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue