davestewart / vuex-pathify

Vue / Vuex plugin providing a unified path syntax to Vuex stores
https://davestewart.github.io/vuex-pathify
MIT License
1.37k stars 57 forks source link

fix(types): add proper generics to accessors #58

Closed KaelWD closed 5 years ago

KaelWD commented 5 years ago

see #38, https://github.com/davestewart/vuex-pathify/pull/38#issuecomment-446712410

@gil0mendes @ozum you were close

davestewart commented 5 years ago

Hey @KaelWD,

Thanks for this. That sure is pretty code! I've been doing typescript for while, but not to this level.

Do you have any resources for where to learn about doing code like you've written in your tests?

I didn't even know you could do this:

Vue.extend({
  computed: get<{
    search: string,
    items: any[]
  }>('products', [
    'search',
    'items',
  ]),
KaelWD commented 5 years ago

If you mean specifically with vue, I don't think there really are any. Otherwise it's mostly just writing TS every day for the past ~year plus a little help from here.

KaelWD commented 5 years ago

Is this ready to merge?

davestewart commented 5 years ago

Sorry @KaelWD - been really distracted with other things.

davestewart commented 5 years ago

Published :)