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

Allow falsy initial state #74

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Allow falsy initial state #74

merged 1 commit into from
Apr 3, 2023

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 3, 2023

This library has used an empty object as the default initial state ever since the initial version, but in older versions that was only set if the initial state was undefined. An initial state of null or any other falsy value other than undefined was still accepted.

In #38 (published as part of v6.0.2) this was accidentally changed. Instead the empty object default was used for any falsy value passed in as the initial state.

The pre-v6.0.2 behavior has now been restored; falsy initial state is no longer overwritten.

This library has used an empty object as the default initial state ever
since the initial version, but in older versions that was only set if
the initial state was undefined. An initial state of `null` or any
other falsy value other than `undefined`  was still accepted.

In #38 (published as part of v6.0.2) this was accidentally changed.
Instead the empty object default was used for any falsy value passed in
as the initial state.

The pre-v6.0.2 behavior has now been restored; falsy initial state is
no longer overwritten.
@Gudahtt Gudahtt requested a review from a team as a code owner April 3, 2023 15:03
Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@Gudahtt Gudahtt merged commit 3874f53 into main Apr 3, 2023
@Gudahtt Gudahtt deleted the allow-falsy-initial-state branch April 3, 2023 15:38
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.

2 participants