The Wayback Machine - https://web.archive.org/web/20210630123102/https://github.com/sveltejs/svelte/pull/5124
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

Use the toggle attribute of the Todo components #5124

Merged
merged 3 commits into from Jun 29, 2021

Conversation

@lukasmoellerch
Copy link
Contributor

@lukasmoellerch lukasmoellerch commented Jul 10, 2020

Modifies the "Immutable Data" example on the svelte website and removes the toggle attribute that was declared. Previously the REPL displayed the following warnings:

ImmutableTodo has unused export property 'toggle'. If it is for external reference only, please consider using export const toggle (ImmutableTodo.svelte:8:12)

MutableTodo has unused export property 'toggle'. If it is for external reference only, please consider using export const toggle (MutableTodo.svelte:6:12)

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 with npm test or yarn test)
@pngwn
Copy link
Member

@pngwn pngwn commented Jul 29, 2020

Is there any precedent in the other tutorials? Should we default to events or callback functions? Or maybe it doesn't matter. We could just remove the toggle prop as a fix for this as well.

@lukasmoellerch
Copy link
Contributor Author

@lukasmoellerch lukasmoellerch commented Jul 30, 2020

@pngwn

Is there any precedent in the other tutorials? Should we default to events or callback functions? Or maybe it doesn't matter. We could just remove the toggle prop as a fix for this as well.

There are several examples where a custom event dispatcher is used, I haven't found any where they are passing a function as a prop directly. I would prefer either passing the function as a prop or using a custom event dispatcher because it provides semantics to the interface of the todo component. But your solution is fine as well.

@Conduitry Conduitry mentioned this pull request Oct 1, 2020
4 tasks done
Copy link
Member

@tanhauhau tanhauhau left a comment

i would prefer removing the export let toggle in both MutableTodo and ImmutableTodo

@stale
Copy link

@stale stale bot commented Jun 26, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 26, 2021
@pngwn pngwn added site and removed site: examples labels Jun 26, 2021
@stale stale bot removed the stale-bot label Jun 26, 2021
@pngwn pngwn added docs and removed site labels Jun 27, 2021
@benmccann benmccann merged commit 2a9f9d7 into sveltejs:master Jun 29, 2021
0 of 16 checks passed
0 of 16 checks passed
@github-actions
Tests (8, ubuntu-latest) Tests (8, ubuntu-latest)
Details
@github-actions
Tests (8, windows-latest) Tests (8, windows-latest)
Details
@github-actions
Tests (8, macOS-latest) Tests (8, macOS-latest)
Details
@github-actions
Tests (10, ubuntu-latest) Tests (10, ubuntu-latest)
Details
@github-actions
Tests (10, windows-latest) Tests (10, windows-latest)
Details
@github-actions
Tests (10, macOS-latest) Tests (10, macOS-latest)
Details
@github-actions
Tests (12, ubuntu-latest) Tests (12, ubuntu-latest)
Details
@github-actions
Tests (12, windows-latest) Tests (12, windows-latest)
Details
@github-actions
Tests (12, macOS-latest) Tests (12, macOS-latest)
Details
@github-actions
Tests (14, ubuntu-latest) Tests (14, ubuntu-latest)
Details
@github-actions
Tests (14, windows-latest) Tests (14, windows-latest)
Details
@github-actions
Tests (14, macOS-latest) Tests (14, macOS-latest)
Details
@github-actions
Lint Lint
Details
@github-actions
Unit (ubuntu-latest) Unit (ubuntu-latest)
Details
@github-actions
Unit (windows-latest) Unit (windows-latest)
Details
@github-actions
Unit (macOS-latest) Unit (macOS-latest)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants