Skip to content

Add useConstructor hook - #11

Merged
manni497 merged 2 commits into
neolution-ch:mainfrom
drebrez:feature/useConstructor
Mar 6, 2026
Merged

manni497 merged 2 commits into
neolution-ch:mainfrom
drebrez:feature/useConstructor

Conversation

@drebrez

@drebrez drebrez commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Introduces a useConstructor hook that executes a provided callback only once during the component's lifecycle, similar to a constructor.

This ensures that initialization logic is performed only once, even after re-renders or component remounts. Includes thorough tests to confirm the hook's behavior in different scenarios.

Closes #7

Introduces a `useConstructor` hook that executes a provided callback only once during the component's lifecycle, similar to a constructor.

This ensures that initialization logic is performed only once, even after re-renders or component remounts. Includes thorough tests to confirm the hook's behavior in different scenarios.
@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/neolution-ch/react-utils/@neolution-ch/react-utils@11

commit: 8ce9787

@drebrez drebrez changed the title Adds useConstructor hook Add useConstructor hook Oct 8, 2025
@manni497
manni497 merged commit e3d8198 into neolution-ch:main Mar 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add useConstructor hook

2 participants