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: Use undefined as a default value (**BREAKING CHANGE**) #306

Merged
merged 6 commits into from
Mar 30, 2022

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Jan 27, 2022

What

This PR uses the new API I have created in my PR (Tencent/MMKV#828) to return undefined instead of 0.0 (getNumber(..)) or false (getBoolean(..)) virtually without any added runtime cost.

Why

Default values of 0.0 or false might be misleading in some cases.

Changes

  • getNumber now returns undefined instead of 0.0 if it was not found in the storage
  • getBoolean now returns undefined instead of false if it was not found in the storage

@mrousavy mrousavy changed the title feat: Use undefined as a default value feat: Use undefined as a default value (**BREAKING CHANGE**) Jan 27, 2022
@jbreuer95

This comment was marked as spam.

@mrousavy mrousavy force-pushed the feat/undefined-default-value branch from 0e8a3ca to 78b00ad Compare March 30, 2022 07:53
@mrousavy mrousavy merged commit 6cbee87 into master Mar 30, 2022
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