HappyNiel / neo-competitor-area

The NEO Competitor Area is a project where teams can create and manage teams for NEO.
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Implement the Vuex store #18

Closed HappyNiel closed 5 years ago

HappyNiel commented 5 years ago

Implement the Vuex store to manage the state of the application.


Found an article which uses Vuex in combination with TypeScript https://codeburst.io/vuex-and-typescript-3427ba78cfa8

HappyNiel commented 5 years ago

Proposed Vuex structure.

...
└── store
    ├── store.ts          # where we assemble modules and export the store
    ├── getters.ts        # root getters
    ├── actions.ts        # root actions
    ├── mutations.ts      # root mutations
    └── modules
        ├── cart.js       # cart module
        └── products.js   # products module
HappyNiel commented 5 years ago

Another tutorial: https://dev.to/sirtimbly/type-safe-vuex-state-usage-in-components-without-decorators-2b24

Using vuex-module-decorators.

HappyNiel commented 5 years ago

Managed to load the user state on app load (basically using F5). Now to properly set up the Vuex store using TS.

HappyNiel commented 5 years ago

The basics of the store are set up.

Next step: Work out the UserModule with all necessary properties, getters, mutations, and actions.

HappyNiel commented 5 years ago

Start it made and it works. Will iterate on it when needed.