Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add init.onlyOnce. #111

Merged
merged 1 commit into from
Oct 17, 2024
Merged

feat: Add init.onlyOnce. #111

merged 1 commit into from
Oct 17, 2024

Conversation

stephenh
Copy link
Contributor

A previous refactoring removed the ability to do init: pojo in
the API, and instead consolidated usage on init: { input: pojo }.

This was good, but a surprising artifact of init: pojo was that it did not re-init as the identity of pojo changes (vs. the init.input = pojo whcih does re-init as the identity changes).

This dictomoy between "one re-inits and one does not" was fairly aribtrary and was a big reason behind removing the "two ways of doing things".

That said, in rolling out the change to internal-frontend, a number of callers were enjoying the implicit useMemo-ification of their init: pojo, and so this PR adds an init.onlyOnce flag that basically restores the "don't watch the init.input identity" behavior.

A previous refactoring removed the ability to do `init: pojo` in
the API, and instead consolidated usage on `init: { input: pojo }`.

This was good, but a surprising artifact of `init: pojo` was that
it did not re-init as the identity of pojo changes (vs. the
`init.input = pojo` whcih *does* re-init as the identity changes).

This dictomoy between "one re-inits and one does not" was fairly
aribtrary and was a big reason behind removing the "two ways of
doing things".

That said, in rolling out the change to internal-frontend, a number
of callers were enjoying the implicit useMemo-ification of their
`init: pojo`, and so this PR adds an `init.onlyOnce` flag that
basically restores the "don't watch the init.input identity"
behavior.
@stephenh stephenh merged commit 67683fb into main Oct 17, 2024
2 checks passed
@stephenh stephenh deleted the feat-only-once branch October 17, 2024 21:40
homebound-team-bot pushed a commit that referenced this pull request Oct 17, 2024
## [2.26.0](v2.25.2...v2.26.0) (2024-10-17)

### Features

* Add init.onlyOnce. ([#111](#111)) ([67683fb](67683fb))
@homebound-team-bot
Copy link

🎉 This PR is included in version 2.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants