mrcrowl / vuex-typex

Typescript builder for strongly-typed access to Vuex Store modules
MIT License
193 stars 22 forks source link

Nested module example #5

Closed tmtk75 closed 6 years ago

tmtk75 commented 6 years ago

Could someone give an example for declaration using nested module?

snovakovic commented 6 years ago

@mrcrowl I'm also interesting to know is it possible to create submodule of the module?

getStoreBuilder<IRootState>().module('testModule', initialState);

Is there a way to creeate subModule module and apply it to testModule as a submodule?

Thanks for nice library!

mrcrowl commented 6 years ago

My apologies for delayed response here, I've been travelling.

See the nested test example here: https://github.com/mrcrowl/vuex-typex/blob/master/src/tests/nested.spec.ts

mrcrowl commented 6 years ago

You can call .module(...) from an existing module builder to create a sub module.

tmtk75 commented 6 years ago

You can call .module(...) from an existing module builder to create a sub module.

Got it. I didn't notice that. Thanks!