13 Matching Annotations
  1. Mar 2021
    1. What are the current trends in JavaScript development?

      Performance, speed, or popularity? What are the most vital characteristics that developers seek in the tech stack? There could hardly be a single reason why certain frameworks rise, while others become the thing of the past.

      What you can do is to observe the driving directions within the front-end landscape. So let’s dive into the top JavaScript trends to watch in 2021.

  2. Dec 2020
    1. Two-way Computed Property Admittedly, the above is quite a bit more verbose than v-model + local state, and we lose some of the useful features from v-model as well. An alternative approach is using a two-way computed property with a setter: <input v-model="message"> // ... computed: { message: { get () { return this.$store.state.obj.message }, set (value) { this.$store.commit('updateMessage', value) } } }

      Handling forms in vuex - use computed properties with a getter and a setter,

      the getter - pulls the value from the store the setter - commits the value to the store

    2. Components Can Still Have Local State Using Vuex doesn't mean you should put all the state in Vuex. Although putting more state into Vuex makes your state mutations more explicit and debuggable, sometimes it could also make the code more verbose and indirect. If a piece of state strictly belongs to a single component, it could be just fine leaving it as local state. You should weigh the trade-offs and make decisions that fit the development needs of your app.

      This is a common pattern I've seen with people adopting tools like [[redux]] or [[Vuex]] for [[state management]] without understanding the [[problems that state management tools aim to solve]]

      • [[Its ok to have local state]]
      • [[Not all state needs to be app state]]

      Not only does putting all of the state into the store cause extra indirection, it can make things complicated if you are putting in state that is tied to the lifecycle of a component - needing to clear / reset the state the next time it loads.

      It can also add complications when you have multiple instances of a component - and trying to make all of it's state got into Vuex - for example, if you had multiple carousel components on a screen - would there be value in trying to manage that state in vuex?

  3. Aug 2020
  4. Mar 2020
  5. Nov 2018
  6. Oct 2018
  7. Mar 2018
    1. Vuex provides a mechanism to "inject" the store into all child components from the root component with the store option (enabled by Vue.use(Vuex)):
    2. You cannot directly mutate the store's state.
    3. Vuex stores are reactive.
  8. Mar 2017
    1. It should be noted that only these proxied properties are reactive. If you attach a new property to the instance after it has been created, it will not trigger any view updates. We will discuss the reactivity system in detail later.

      VERY IMPORTANT CAVEAT!