34 Matching Annotations
  1. Last 7 days
    1. Imperative UI causes all sorts of problems, most of which revolve around state, which is another fancy term meaning “values we store in our code”. We need to track what state our code is in, and make sure our user interface correctly reflects that state.
  2. Oct 2020
    1. Instead of using classes and local state, Deku just uses functions and pushes the responsibility of all state management and side-effects onto tools like Redux.
    1. The $ contract for auto-sub­scrib­ing is lovely in its sim­plic­ity and flex­i­bil­ity. You can adapt your own preferred state-man­age­ment pattern or library, with or without Svelte stores as helpers. Svelte does not fuss about how you want to manage your state.
  3. Sep 2020
    1. React Stately is a library of state management hooks for use in your component library.
    1. Provides state management for tree-like components. Handles building a collection of items from props, item expanded state, and manages multiple selection state.
    1. So why don't we extract the shared state out of the components, and manage it in a global singleton? With this, our component tree becomes a big "view", and any component can access the state or trigger actions, no matter where they are in the tree!
    1. It turns out that even the length of time an element has been mounted is an important piece of state that determines what pixels the user sees. And some of this state can’t simply be lifted into our application state.

      What this means is that our desire to express UI using pure functions is in direct conflict with the very nature of the DOM. It’s a great way to describe a state => pixels transformation — perfect for game rendering or generative art — but when we’re building apps on the web, the idea chafes against the reality of a stateful medium.

    1. Stores are global state. While context is local state.
    2. Notice it's not related to components. Another crucial difference is that it's accessible from outside of components. And good way to determine where goes where is to ask yourself, can this particular state and functionality still makes sense outside of the displayed component?
  4. Jul 2020
  5. Jun 2020
    1. State management is also easier. Instead of importing hooks and using setters, you just define a property within the script tags. You then change the value by re-assigning it (not mutating the original value).
  6. Nov 2019
  7. Oct 2019
    1. However, if more control is needed, you can pass any of these pieces of state as a prop (as indicated above) and that state becomes controlled. As soon as this.props[statePropKey] !== undefined, internally, downshift will determine its state based on your prop's value rather than its own internal state.
  8. Sep 2019
    1. One way to guarantee write consistency is by utilizing the event store’s optimistic concurrency control. A proper event store provides a way for the user to say “save this event only if the version of the entity is still x”.
    2. One alternative would be to have one topic per entity

      Other alternative: have a consumer group write a read model to a database, indexed by entity id.

  9. Aug 2018
    1. Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects.

      So how model layer can be integreted?