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

Make start mandatory in the Readable store api. #8300

Closed
fredguth opened this issue Feb 21, 2023 · 2 comments
Closed

Make start mandatory in the Readable store api. #8300

fredguth opened this issue Feb 21, 2023 · 2 comments

Comments

@fredguth
Copy link

Describe the problem

There seems to be no reason to create a Readable store which does not change. Still, not only the Readable Store api allows it, but there is a test for it, demonstrating this is intentional (

it('creates a readable store without updater', () => {
)

This seems a meaningless change, but it may help people seeing stores for the first time.

Describe the proposed solution

I would like to make start mandatory for creating a readable store.

Alternatives considered

Explain why it should be optional.

Importance

nice to have

@Conduitry
Copy link
Member

Making this mandatory would be a breaking change.

As for why you might want a store that does not change - if you have some component/API that expects one of its props to be passed as a store, but you, the creator of the component or caller of the API, know that that value is never going to need to change, you can pass this constant store to the component/API.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
@karimfromjordan
Copy link

For more context:
Related issue
Related PR

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

No branches or pull requests

3 participants