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

Extend "Custom stores" example & tutorial #3720

Closed
wants to merge 1 commit into from
Closed

Extend "Custom stores" example & tutorial #3720

wants to merge 1 commit into from

Conversation

TorstenDittmann
Copy link
Contributor

@TorstenDittmann TorstenDittmann commented Oct 16, 2019

Extended custom store example for passing data to a method.

When I started working with svelte, an example like the one in this PR would have helped me a lot.

related: #3053

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests tests with npm test or yarn test)

Extended custom store example for passing data to a method.
@Rich-Harris
Copy link
Member

Thank you, though I'm going to close this — the added example is perhaps a bit confusing (it reimplements set with a different name in a tutorial that's about not exposing set).

While people do trip up over passing parameters to functions (the difference between on:click={foo} and on:click={() => foo(42)}), that's not specific to custom stores, and is shown elsewhere in the tutorial (e.g. two chapters later, and there's a chapter on inline event handlers). I think we need to be careful not to fall into the trap of explaining everything in every tutorial chapter, because it makes the tutorial as a whole longer and more repetitive. It's designed to be read from start to finish, rather than for each chapter to be completely standalone.

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