christianmalek / vuex-rest-api

A utility to simplify the use of REST APIs with Vuex
http://vuex-rest-api.org
MIT License
382 stars 48 forks source link

Broken type definitions for getStore #67

Closed gcbirzan closed 6 years ago

gcbirzan commented 6 years ago

Vapi.getStore is declared as returning a Store object, but if you pass createStateFn: false, that's not the case.

First of all, I think that API is silly. There should be a different function, maybe getStoreObject that abstracts this. But, even if you don't agree with that idea, the type definition needs to be updated.

christianmalek commented 6 years ago

Hey @gcbirzan,

thanks for your bug report. I'll fix this soon.

Could you please elaborate why you think the API is silly? Do you see think the passed config object({ createStateFn: false} is'nt clear enough? Or do you refer to avoid union return types?

christianmalek commented 6 years ago

I'll close this issue. Feel free to reopen it.