Andorbal / svelte-router-example

Simple Svelte app that uses a router to select "pages."
MIT License
17 stars 5 forks source link

content should be reset . #3

Open MiYogurt opened 7 years ago

MiYogurt commented 7 years ago

qq20161209-0

Andorbal commented 7 years ago

Do you have an example of how you'd fix this? Does this issue manifest itself in an app or just when working with the code manually?

MiYogurt commented 7 years ago

I'm sorry I don't have a clear description, causing distress to you, because I do not have much experience to submit issue, my English is not very good, basically use the translation tool, so I usually is more fear to submit issue.

I am referring to your project, use typescript write a svelte project,a todo app.

the project in there https://github.com/MiYogurt/svelte-with-ts

i find the code have some err. cause routing exception

in this file line 36

https://github.com/Andorbal/svelte-router-example/blob/master/src/services/createRouter.js
 if (content && content.teardown) content.teardown();

so i think the content should be reset .

event if you call method teardown() the content && content.teardown stil true

if (content) {
      content.teardown();
      content = undefined;
    }

I hope you can close this issue after reading, my poor English is my biggest failure.

Andorbal commented 7 years ago

Oh, I see what you're saying! And I agree with you; I'll see if I can get a fix for that tonight.

And no worries, your English was fine :)