Vuex Pathify 1.2 now has TypeScript typings and decorators


#1

Example:

import { Get, Sync, Call } from 'vuex-pathify'

@Components
export default class Item extends Vue {
  @Get('products/items') items!: Item[]
  @Sync('products/tax') tax!: number
  @Call('products/setDiscount') setDiscount!: (rate: number) => any
}

Which is the equivalent of:

import { get, sync, call } from 'vuex-pathify'

export default {
  computed: {
    items: get('products/items'),
    tax: sync('products/tax'),
  },

  methods: {
    setDiscount: call('products/setDiscount')
  }
}

Docs:

Install: