https://github.com/ratonbiswas/vue-learning
https://github.com/ratonbiswas/vue-learning
firebase firebase-auth vuejs vuex
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ratonbiswas/vue-learning
- Owner: RatonBiswas
- Created: 2023-05-24T11:58:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-27T11:33:18.000Z (almost 3 years ago)
- Last Synced: 2025-04-09T08:34:55.329Z (about 1 year ago)
- Topics: firebase, firebase-auth, vuejs, vuex
- Language: Vue
- Homepage: https://icoaches.netlify.app/coaches
- Size: 259 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vue-learning
### Vuex terms
# State
App-level state/data (it should be posts, token , todos, etc)
# Getters
Get pieces of state or computed values from state
# Actions
called from components to commit a mutation
# Mutations
Mutate the state (Update data etc)
# Modules
Each module can have its own state , getters, actions and mutationas (Auth modules, Posts module, etc)
### Accessing Mutations and Actions
# When accessing mutations and actions, you can simply provide the commit and dispatch method inside the setup hook.
import { computed } from 'vue'
import { useStore } from 'vuex'
const store = useStore()
// access a mutation
const increment = ()=>store.commit('increment'),
// access an action
const asyncIncrement = ()=> store.dispatch('asyncIncrement')
### Accessing State and Getters#
# In order to access state and getters, you will want to create computed references to retain reactivity. This is the equivalent of creating computed properties using the Option API.
import { computed } from 'vue'
import { useStore } from 'vuex'
const store = useStore()
// access a state in computed function
const count = computed(() => store.state.count),
// access a getter in computed function
const double = computed(() => store.getters.double)