11 Matching Annotations
  1. Jun 2023
  2. Jun 2021
    1. A rule of thumb is that data should just be data - it is not recommended to observe objects with their own stateful behavior.
  3. Apr 2021
  4. Feb 2021
    1. In other words: the controllers usually contain only routing and rendering code and dispatch instantly to a particular operation/activity class.
  5. Jan 2021
    1. If it's behaviour that you can imagine needing to reuse among multiple components, or if it's something that you can imagine applying to an element inside an {#if ...} block (for example), then it probably belongs in an action. It it's something that 'belongs' to the component itself, rather than a specific element, then it's probably more of a lifecycle thing.
  6. Oct 2020
    1. A simple rule of thumb: the name of the updated variable must appear on the left hand side of the assignment. For example this... const foo = obj.foo; foo.bar = 'baz';...won't update references to obj.foo.bar, unless you follow it up with obj = obj.
    1. Could I get your intuition for why that rule of thumb applies to svelte components but not Javascript functions? I tend to make heavy use of let x = e when writing normal Javascript, as I do in most other languages (though unlambda is a notable exception). How is svelte different?
  7. Jan 2020
    1. Most copyright experts recommend this rule of thumb -- when in doubt, assume a work is copyrighted and ask permission to use it.

      expert advice.