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

fix(localstored): mark "engine"-option as optional #372

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

Addono
Copy link
Contributor

@Addono Addono commented Dec 30, 2022

The documentation and code mark the "engine"-prop as optional. However, the TypeScript type enforces it to be required, therefore any consumer who tries to omit this prop and use the default built-in engine gets a TypeScript error.

This change updates the argument-type of localstored, such that the "engine"-option becomes optional. Which allows a consumer to use the default build-in LocalStorage-based engine.

Old behaviour:
image

Documentation examples show usage of this plugin without explicitly setting an implementation for the engine:
https://github.com/avkonst/hookstate/blob/master/docs/index/src/examples/plugin-localstored.tsx

The documentation and code mark the "engine"-prop as optional. However, the TypeScript type enforces it to be required, therefore any consumer who tries to omit this prop and use the default build-in engine gets a TypeScript error.

This change updates the argument-type of localstored, such that the "engine"-option becomes optional. Which allows a consumer to use the default build-in LocalStorage-based engine.
@codecov-commenter
Copy link

Codecov Report

Base: 82.61% // Head: 82.61% // No change to project coverage 👍

Coverage data is based on head (fb05433) compared to base (8319bd5).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #372   +/-   ##
=======================================
  Coverage   82.61%   82.61%           
=======================================
  Files           2        2           
  Lines         880      880           
  Branches      254      254           
=======================================
  Hits          727      727           
  Misses        120      120           
  Partials       33       33           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ssysm
Copy link

ssysm commented Jan 29, 2023

bump this PR, related to #370 as well.

@avkonst
Copy link
Owner

avkonst commented Jan 30, 2023

Thanks for pr. I am offline on holidays at the moment. I will release once I am back.

@avkonst avkonst merged commit 5262963 into avkonst:master Jan 30, 2023
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.

4 participants