@resourge/react-fetch
Version:
[](LICENSE)
26 lines (23 loc) • 671 B
JavaScript
/**
* react-fetch v1.41.3
*
* Copyright (c) resourge.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
import { useRef, useEffect } from 'react';
import NotificationService from '../services/NotificationService';
const useFetchOnDependencyUpdate = (deps, filterRequest) => {
const firstRef = useRef(true);
useEffect(() => {
if (!firstRef.current) {
NotificationService.requestAllAgain(filterRequest);
}
firstRef.current = false;
}, deps);
};
export { useFetchOnDependencyUpdate };
//# sourceMappingURL=useFetchOnDependencyUpdate.js.map