-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Typescript typings and improve the building process
- Loading branch information
Showing
18 changed files
with
363 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import "./vue"; | ||
import { VueWarehouse } from "./warehouse"; | ||
export default VueWarehouse; | ||
// export { | ||
// VueWarehouseSync | ||
// } from "./sync"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import "./vue"; | ||
import { VueWarehouse } from "./warehouse"; | ||
|
||
export default VueWarehouse; | ||
|
||
export { sync, store } from "./warehouse"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Vue from "vue"; | ||
// import Vuex from "vuex"; | ||
import VueWarehouse from "../index"; | ||
// import WarehouseSync from "../sync"; | ||
// import WarehouseStore from '@/store' | ||
var store = require("store"); | ||
// Vue.use(Vuex); | ||
Vue.use(VueWarehouse, { | ||
store: store | ||
}); | ||
var moduleName = "warehouse"; | ||
// WarehouseSync(Vue.prototype.$store, store, { | ||
// moduleName: moduleName | ||
// }); | ||
// Set new user | ||
Vue.prototype.$warehouse.set("user", "John"); | ||
// Vue.prototype.$store.state[moduleName].key; | ||
// Vue.prototype.$store.state[moduleName].value; | ||
// Vue.prototype.$store.state[moduleName].oldValue; | ||
// Update user | ||
Vue.prototype.$warehouse.set("user", "Jane"); | ||
// Vue.prototype.$store.state[moduleName].key; | ||
// Vue.prototype.$store.state[moduleName].value; | ||
// Vue.prototype.$store.state[moduleName].oldValue; | ||
// Remove user | ||
Vue.prototype.$warehouse.remove("user"); | ||
// Vue.prototype.$store.state[moduleName].key; | ||
// Vue.prototype.$store.state[moduleName].value; | ||
// Vue.prototype.$store.state[moduleName].oldValue; | ||
// Clear all values | ||
Vue.prototype.$warehouse.set("user", "Jane"); | ||
Vue.prototype.$warehouse.set("id", 1); | ||
Vue.prototype.$warehouse.clearAll(); | ||
// Vue.prototype.$store.state[moduleName].key; | ||
// Vue.prototype.$store.state[moduleName].value; | ||
// Vue.prototype.$store.state[moduleName].oldValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
declare var require: any; | ||
|
||
import Vue from "vue"; | ||
import Vuex from "vuex"; | ||
|
||
import VueWarehouse from "../index"; | ||
import { sync as WarehouseSync } from "../index"; | ||
import { store as WarehouseStore } from "../index"; | ||
|
||
const store = WarehouseStore({ | ||
store: require("store") | ||
}); | ||
|
||
Vue.use(Vuex); | ||
Vue.use(VueWarehouse, { | ||
store: store | ||
}); | ||
|
||
const moduleName = "warehouse"; | ||
|
||
const VuexStore = new Vuex.Store({ | ||
state: { msg: "foo" } | ||
}); | ||
|
||
WarehouseSync(VuexStore, store, { | ||
moduleName: moduleName | ||
}); | ||
|
||
// Set new user | ||
Vue.prototype.$warehouse.set("user", "John"); | ||
// Update user | ||
Vue.prototype.$warehouse.set("user", "Jane"); | ||
// Remove user | ||
Vue.prototype.$warehouse.remove("user"); | ||
// Clear all values | ||
Vue.$warehouse.clearAll(); | ||
|
||
Vue.prototype.$store.state[moduleName].key; | ||
Vue.prototype.$store.state[moduleName].value; | ||
Vue.prototype.$store.state[moduleName].oldValue; |
Oops, something went wrong.