Skip to content

Commit

Permalink
=! useEffect2 will trigger the callback whenever the dependency arr…
Browse files Browse the repository at this point in the history
…ay size change, this is different from `useEffect`, but more intuitive

! `useConditionalHooks` will correctly update the result when called hook returns an array
  • Loading branch information
dzek69 committed Dec 30, 2023
1 parent 1b2ca86 commit 64d016e
Show file tree
Hide file tree
Showing 9 changed files with 771 additions and 546 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [UNRELEASED]
(nothing yet)

## [2.0.0] - 2023-12-30
### Breaking
- `useEffect2` will trigger the callback whenever the dependency array size change, this is different from `useEffect`,
but more intuitive
### Fixed
- `useConditionalHooks` will correctly update the result when called hook returns an array

## [1.2.2] - 2023-09-11
### Fixed
- SSR when using `useCrossTabs`
Expand Down
26 changes: 26 additions & 0 deletions build-scripts/utils.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { spawn } from "child_process";

const run = (command, args) => {
return new Promise((resolve, reject) => {
const cmd = spawn(command, args, {
stdio: ["ignore", "inherit", "inherit"],
});

cmd.on("close", (code) => {
if (!code) {
resolve();
return;
}

reject(new Error(`Program exited with code ${code}`));
});

cmd.on("error", () => {
reject(new Error(`Can't start program`));
});
});
};

export {
run
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ezez/hooks",
"version": "1.2.2",
"version": "2.0.0",
"repository": "[email protected]:dzek69/ezez-hooks.git",
"author": "Jacek Nowacki",
"license": "MIT",
Expand Down Expand Up @@ -36,9 +36,9 @@
"oop-timers": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.22.8",
"@babel/preset-env": "^7.22.7",
"@babel/preset-typescript": "^7.22.5",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"@babel/preset-typescript": "^7.23.3",
"@dzek69/eslint-config-base": "^2.5.0",
"@dzek69/eslint-config-import": "^1.3.0",
"@dzek69/eslint-config-import-typescript": "^1.0.1",
Expand All @@ -61,7 +61,7 @@
"husky": "^8.0.3",
"jest": "^29.6.1",
"must": "^0.13.4",
"next": "^13.4.19",
"next": "^14.0.4",
"nodemon": "^3.0.1",
"prettier": "^2.8.8",
"react": "^18.2.0",
Expand Down
Loading

0 comments on commit 64d016e

Please sign in to comment.