source: imaps-frontend/node_modules/react-use/esm/useLogger.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 661 bytes
Line 
1import { __spreadArrays } from "tslib";
2import useEffectOnce from './useEffectOnce';
3import useUpdateEffect from './useUpdateEffect';
4var useLogger = function (componentName) {
5 var rest = [];
6 for (var _i = 1; _i < arguments.length; _i++) {
7 rest[_i - 1] = arguments[_i];
8 }
9 useEffectOnce(function () {
10 console.log.apply(console, __spreadArrays([componentName + " mounted"], rest));
11 return function () { return console.log(componentName + " unmounted"); };
12 });
13 useUpdateEffect(function () {
14 console.log.apply(console, __spreadArrays([componentName + " updated"], rest));
15 });
16};
17export default useLogger;
Note: See TracBrowser for help on using the repository browser.