Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
ffe7be76
Verified
Commit
ffe7be76
authored
Apr 12, 2020
by
Florent Chehab
Browse files
feat(hook): added useOnComponentUnMount
parent
223eb05c
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/hooks/useOnComponentUnMount.js
0 → 100644
View file @
ffe7be76
import
{
useEffect
}
from
"
react
"
;
/**
* Hook to run a method on component un-mount.
*
* @param {Function} execOnUnMount
*/
function
useOnComponentUnMount
(
execOnUnMount
)
{
useEffect
(()
=>
{
return
execOnUnMount
;
},
[]);
}
export
default
useOnComponentUnMount
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment