Conversation
benmccann
left a comment
There was a problem hiding this comment.
looks good to me. As a heads up, the build is failing. Looks like you might need to update pnpm-lock.yaml
examples/realworld.svelte.dev/src/routes/settings/_SettingsForm.svelte
Outdated
Show resolved
Hide resolved
| @@ -0,0 +1,28 @@ | |||
| const noop = () => {}; | |||
|
|
|||
| export function ajax(node, { onsubmit = noop, onresponse = noop } = {}) { | |||
There was a problem hiding this comment.
I somewhat wonder if this would be a nice helper to have in SvelteKit. (I might call it formHandler instead of ajax)
There was a problem hiding this comment.
I think something like this should be easy to reuse, though I don't know if this is exactly the right thing — it does some slightly opinionated stuff (like setting the accept header, so that a no-JS form submission can get a 303 response while an AJAX submission gets the posted data), and we'd need to be more careful about the design if it wasn't just a little helper inside one of the example apps.
But yeah, would be nice to have some version of this in the toolkit, though maybe in Svelte itself rather than SvelteKit-specific (sveltejs/rfcs#24)
|
i guess there's one major downside of storing the whole JWT in the cookie — if you change user details in one browser (e.g. desktop) they won't be reflected when you log in via another (e.g. mobile). So I guess we have to just store the token and communicate with the realworld API to get user data for each request |
|
this is currently broken, am working on getting it finished (or at least 'acceptable') |
|
No doubt there's more that can be done here but I think it makes sense to merge this in its current state |
No description provided.