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

remove get() with string from Svelte calls #169

Merged
merged 5 commits into from
Apr 19, 2018

Conversation

nolanlawson
Copy link
Owner

This has some odd failures that I'm currently working around (with get() || {}), but it's something we need to do because get('foo') is getting deprecated: sveltejs/svelte#1347

@nolanlawson
Copy link
Owner Author

I don't know why get() sometimes returns null/undefined, but it seems to happen within scheduleIdleTask() which means it's happening outside of the component lifecycle, so that's probably it. I don't want to wrap every get() call ever though.

@nolanlawson
Copy link
Owner Author

minimal svelte template to demonstrate what's causing the null bugs:

<h1>Hello {{name}}!</h1>

<script>
	export default {
		oncreate() {
			setTimeout(() => this.destroy(), 1000)
			setTimeout(() => {
				let { name } = this.get()
				console.log('name', name)
			}, 2000)
		}
	}
</script>

@nolanlawson
Copy link
Owner Author

bug filed on svelte: sveltejs/svelte#1354

@nolanlawson nolanlawson merged commit 8d5690d into master Apr 19, 2018
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.

1 participant