Giter VIP home page Giter VIP logo

pinia-generic's People

Contributors

dependabot[bot] avatar rettend avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

pinia-generic's Issues

Example of multi-depth inheritence

So I have successfully used pinia-generic in my project to extend a base store. An example would be for the generic:
https://github.com/stamp-web/stamp-web-vuejs/blob/main/src/stores/baseModelStore.ts

and then the implementaton:
https://github.com/stamp-web/stamp-web-vuejs/blob/main/src/stores/albumStore.ts

This works Perfectly! and compared to my first attempt of a single store having entity type named methods is a thing of beauty. But I have been having trouble figuring out how to declare a level in between. ie. a Generic Store to extend a Generic Store. Ideally I'd want something like

baseModelStore<T extends PersistedModel> { }
baseManagedStore<T extends PersistedNamedModel>{ // extends the baseModelStore but has some new implementation }
albumStore extends baseManagedStore<Album>

For the baseManagedStore I created my type that extended the BaseModelStoreType but then it was unclear whether for the store I have to make this "useStore" or use the "defineGenericStore". The later seems like what I'd want here - to define a generic, add some implementation but extend the baseModelStore - just not sure how to make it "extend" the baseModelStore I guess.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.