@ptolemy2002/react-mount-effects 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/index.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,12 @@ For now, the library makes use of React 18 and does not use TypeScript.
|
|
|
5
5
|
## Commands
|
|
6
6
|
The following commands exist in the project:
|
|
7
7
|
|
|
8
|
+
- `npm run uninstall` - Uninstalls all dependencies for the library
|
|
9
|
+
- `npm run reinstall` - Uninstalls and then Reinstalls all dependencies for the library
|
|
10
|
+
- `npm run example-uninstall` - Uninstalls all dependencies for the example app
|
|
11
|
+
- `npm run example-install` - Installs all dependencies for the example app
|
|
12
|
+
- `npm run example-reinstall` - Uninstalls and then Reinstalls all dependencies for the example app
|
|
13
|
+
- `npm run example-start` - Starts the example app after building the library
|
|
8
14
|
- `npm run build` - Builds the library
|
|
9
15
|
- `npm run release` - Publishes the library to npm without changing the version
|
|
10
16
|
- `npm run release-patch` - Publishes the library to npm with a patch version bump
|
package/index.js
CHANGED
|
@@ -25,7 +25,9 @@ __export(src_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
var import_react = require("react");
|
|
27
27
|
function useMountEffect(callback) {
|
|
28
|
-
(0, import_react.useEffect)(
|
|
28
|
+
(0, import_react.useEffect)(() => {
|
|
29
|
+
callback();
|
|
30
|
+
}, []);
|
|
29
31
|
}
|
|
30
32
|
function useUnmountEffect(callback) {
|
|
31
33
|
(0, import_react.useEffect)(() => callback, []);
|