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:
332 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import { useEffect } from 'react';
|
---|
| 2 | import { useFirstMountState } from './useFirstMountState';
|
---|
| 3 | var useUpdateEffect = function (effect, deps) {
|
---|
| 4 | var isFirstMount = useFirstMountState();
|
---|
| 5 | useEffect(function () {
|
---|
| 6 | if (!isFirstMount) {
|
---|
| 7 | return effect();
|
---|
| 8 | }
|
---|
| 9 | }, deps);
|
---|
| 10 | };
|
---|
| 11 | export default useUpdateEffect;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.