Skip to content

Commit

Permalink
Fixed issue with store not being available to core UI components.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshall-slicedbread committed Oct 11, 2023
1 parent 8f1bbed commit 8607961
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 7 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"tiptap-vuetify": "^2.24.0",
"vue": "~2.6.11",
"vue-router": "~3.5.3",
"vuetify": "~2.4.0"
"vuetify": "~2.4.0",
"vuex": "~3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
Expand Down
4 changes: 3 additions & 1 deletion src/framework/actionSheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import ActionSheet from './ActionSheet.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* actionSheet({
Expand All @@ -22,7 +23,8 @@ const ActionSheetConstructor = Vue.extend(ActionSheet)

function createCmp(options) {
const cmp = new ActionSheetConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
4 changes: 3 additions & 1 deletion src/framework/banner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import Banner from './Banner.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* banner({
Expand All @@ -16,7 +17,8 @@ const BannerConstructor = Vue.extend(Banner)

function createCmp(options) {
const cmp = new BannerConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
4 changes: 3 additions & 1 deletion src/framework/dialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import Dialog from './Dialog.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* dialog(MyComponent, options)
Expand All @@ -13,7 +14,8 @@ function createCmp(childComponent, options) {

// Instantiate dialog
const cmp = new DialogConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
4 changes: 3 additions & 1 deletion src/framework/loading/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import Loading from './Loading.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* var l = loading()
Expand All @@ -16,7 +17,8 @@ var depth = 0;

function createCmp(options) {
const cmp = new LoadingConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
4 changes: 3 additions & 1 deletion src/framework/messageBox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import MessageBox from './MessageBox.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* messageBox({
Expand All @@ -18,7 +19,8 @@ const MessageBoxConstructor = Vue.extend(MessageBox)

function createCmp(options) {
const cmp = new MessageBoxConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
4 changes: 3 additions & 1 deletion src/framework/toast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Vue from 'vue'
import Toast from './Toast.vue'
import Vuetify from 'vuetify/lib'
import { Router } from "../../plugins/router.js"
import { Store } from '../../plugins/store.js'

/* Usage:
* toast({
Expand All @@ -21,7 +22,8 @@ const toasts = []

function createCmp(options) {
const cmp = new ToastConstructor({
router: Router.instance
router: Router.instance,
store: Store.instance
});

const vuetifyObj = new Vuetify()
Expand Down
2 changes: 2 additions & 0 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { override } from "./app/settings.js";
import { useVuetify } from "./plugins/vuetify.js";
import { useTipTapVuetify } from "./plugins/tiptap-vuetify.js";
import { useRouter } from "./plugins/router.js";
import { useStore } from "./plugins/store.js";

import SharedoAuth from "./infra/authcode.js";
import SharedoFetch from "./infra/fetchWrapper.js";
Expand Down Expand Up @@ -53,6 +54,7 @@ export {
useVuetify,
useTipTapVuetify,
useRouter,
useStore,

// Services
SharedoAuth,
Expand Down
17 changes: 17 additions & 0 deletions src/plugins/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Vue from 'vue'
import Vuex from "vuex";

Vue.use(Vuex);

class Store { }

const useStore = config => {
Store.instance = new Vuex.Store(config);

return Store.instance;
}

export {
Store,
useStore
}

0 comments on commit 8607961

Please sign in to comment.