27 Matching Annotations
  1. Last 7 days
    1. export const state: State = $state({ user: undefined });

      The problem is, this creates global (server-wide) state, when it should be "user-local" global state.

    2. One pattern that I love to use in my SvelteKit projects is returning writable stores from the layout’s load function. This makes it possible to fetch data from the server (for example the user object for the logged in user), and then you make this object available as a writable reactive store throughout the whole application. So when the user updates their username or avatar, you do the PUT request to the server and you get the updated user object back from the server as the response, you can simply update the $user writable store value and every place in your app where you show the user object gets updated immediately.
    1. But what if you want to update this user instance? For example on your website you have a form where the user can change their name, username, or avatar. When the form is submitted this gets stored on the server, but the site still shows the old user information, for example it still shows the old avatar of the user in the top menu. The user variable isn’t writable, so how do you overwrite this?
  2. Oct 2023
  3. Jan 2022
  4. Nov 2021
  5. Sep 2021
  6. Aug 2021
    1. Rafael Irizarry. (2021, August 8). Vaccines work in a gif update: COVID19 cases versus vaccination rates in US states through time. The Delta variant effect can be seen clearly starting in July. States with lower vaccination rates are affected much worse. Https://t.co/e0SQpa8Qg0 [Tweet]. @rafalab. https://twitter.com/rafalab/status/1424440520361787392

  7. Jul 2021
  8. Mar 2021
  9. Oct 2020
  10. Sep 2020
    1. Provides state management for tree-like components. Handles building a collection of items from props, item expanded state, and manages multiple selection state.
  11. Aug 2020
  12. Jul 2020
  13. May 2020
  14. Apr 2020