import React, {useEffect} from "react";
export const useEffectAsync = (fn, deps) => {
useEffect(() => {
fn();
}, deps);
};
export const useComponentWillMount = (fn) => {
let ref = useRef(false);
useEffect(() => {
if (!ref.current) {
fn();
ref.current = true;
}
});
};
export const useComponentWillMount2 = (fn) => {
useEffect(() => {
fn();
/* eslint-disable-next-line */
}, []);
};
sahilrajput03/useeffect-factory
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published