Skip to content

Instantly share code, notes, and snippets.

View michtio's full-sized avatar
🏠
Working from home

Michael Thomas michtio

🏠
Working from home
View GitHub Profile
@unstoppablecarl
unstoppablecarl / how-i-use-vuex.js
Last active June 17, 2020 14:59
How I use vuex
// within a vue component only use mapGetters, mapActions, or this.$store.dispatch(...)
// never directly reference state or mutations from within a vue component
// clearly shows what state data should be exposed and should be internal
import Vue from 'vue'
import Record from '...'
import api from '...'
const store = {
state: {
foo: true,
<?php
namespace modules;
use Craft;
use craft\controllers\EntriesController;
use craft\controllers\UsersController;
use yii\base\ActionEvent;
use yii\base\Event;
use yii\base\Module;
use yii\web\ForbiddenHttpException;