Giter Site home page Giter Site logo

maoberlehner / how-to-structure-a-complex-vuex-store Goto Github PK

View Code? Open in Web Editor NEW
187.0 9.0 36.0 327 KB

This is an example project for the following article: https://markus.oberlehner.net/blog/how-to-structure-a-complex-vuex-store/

JavaScript 47.87% HTML 2.97% Vue 49.16%

how-to-structure-a-complex-vuex-store's Introduction

How to Structure a Complex Vuex Store

Patreon Donate

This is an example project for the following article: How to Structure a Complex Vuex Store

Build Setup

# Install dependencies.
npm install

# Serve with hot reload at localhost:8080
npm run serve

# Build for production with minification.
npm run build

About

Author

Markus Oberlehner
Website: https://markus.oberlehner.net
Twitter: https://twitter.com/MaOberlehner
PayPal.me: https://paypal.me/maoberlehner
Patreon: https://www.patreon.com/maoberlehner

License

MIT

how-to-structure-a-complex-vuex-store's People

Contributors

maoberlehner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

how-to-structure-a-complex-vuex-store's Issues

Clear vuex state

If we want to clear data when our component destroyed in order we do not cache data, can we subscribe destroyed hook and call vuex action resetForm?

Or this behavior is not preferably?

persistedState

great example! really helped me. But I have a problem when I use persisted state. I want the entire state to persist over refresh. So I use the vuex-persistedState plugin - eg:
`Vue.use(Vuex)

export default new Vuex.Store({
strict: true,
plugins: [
createPersistedState()
],`

But when I do this I end with with all sorts of errors: eg.
[vuex] module namespace not found in mapGetters():

As soon as I remove the plug in all is fine - except you can't hit F5.

Any ideas?

class to vuex module

Servus!

I have just stared using vuex, so I might not be able to implement this functionality right now.
However, I figure it might not be a big deal to generate modules from models, so why writing a module for every class manually?
Wouldn't it be more convenient to load the standard stuff via a mixin(model) and then add only module specific code?

Kind regards to LNZ,
pate

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.