8000 Improve documentation on Stores internals · Issue #8298 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

Improve documentation on Stores internals #8298

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

Open
fredguth opened this issue Feb 21, 2023 · 1 comment
Open

Improve documentation on Stores internals #8298

fredguth opened this issue Feb 21, 2023 · 1 comment

Comments

@fredguth
Copy link

Describe the problem

I'm frustrated that it is not clear for a newbie what a start callback is. It is clear that a Readable that doesn't change is not useful, but there is no metaphor in the documentation explaining start. There are good examples, though.

Besides, the source code doesn't help either. For example:

/** Cleanup logic callback. */

/** Cleanup logic callback. */
type Invalidator<T> = (value?: T) => void;

What information does this description give?

After a long time trying to understand what an Invalidator is, I think it is about making stores compatible with rxjs, but this is not clear from the documentation nor the source code.

Describe the proposed solution

I would like to see a better metaphor about the start callback in the documentation. And references in the source-code to what Invalidator, StartStopNotifier are. The current definitions in the source code are "tautologic", for example:
A StartStopNotifier Start and stop notification callbacks..

Alternatives considered

A blog post.

Importance

nice to have

@samal-rasmussen
Copy link
samal-rasmussen commented Aug 16, 2023

More info on invalidate on StackOverflow:
https://stackoverflow.com/questions/76915395/what-is-the-second-invalidate-argument-to-readable-subscribe

Seems like an implementation detail to fix glitchy derived stores. Is there any use case for the public? If not then it should be removed from the docs, right?

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

No branches or pull requests

3 participants
0