svelte-store

Svelte user registration issue with setting store value

醉酒当歌 提交于 2020-12-12 14:25:08
问题 helo :) I'm trying to register an user and after success, setContext to newly registered user and then navigate to home. Server properly responds and registers user, but when setContext is called i get the following error: "index.mjs:552 Uncaught (in promise) Error: Function called outside component initialization" <script> import { setContext } from 'svelte' async function handleRegistration(e) { let user = { firstname: e.target.firstname.value, lastname: e.target.lastname.value, } fetch(

Svelte user registration issue with setting store value

人走茶凉 提交于 2020-12-12 14:21:26
问题 helo :) I'm trying to register an user and after success, setContext to newly registered user and then navigate to home. Server properly responds and registers user, but when setContext is called i get the following error: "index.mjs:552 Uncaught (in promise) Error: Function called outside component initialization" <script> import { setContext } from 'svelte' async function handleRegistration(e) { let user = { firstname: e.target.firstname.value, lastname: e.target.lastname.value, } fetch(

Svelte user registration issue with setting store value

对着背影说爱祢 提交于 2020-12-12 14:21:09
问题 helo :) I'm trying to register an user and after success, setContext to newly registered user and then navigate to home. Server properly responds and registers user, but when setContext is called i get the following error: "index.mjs:552 Uncaught (in promise) Error: Function called outside component initialization" <script> import { setContext } from 'svelte' async function handleRegistration(e) { let user = { firstname: e.target.firstname.value, lastname: e.target.lastname.value, } fetch(