@mobilizing/soundworks-plugin-vue-helpers
v2.0.0
Published
soundworks plugin for Vue.js based applications
Readme
soundworks | plugin vue helpers
soundworks plugin for Vue.js based applications.
Table of Contents
Installation
npm install @mobilizing/soundworks-plugin-vue-helpers --saveUsage
Composables
useBaseProps
import useBaseProps from "@mobilizing/soundworks-plugin-vue-helpers/composables/use-base-props.js";
<script setup>
const props = defineProps({
...useBaseProps(),
});
</script>useStateStore
import useStateStore from "@mobilizing/soundworks-plugin-vue-helpers/composables/use-state-store.js";
<script setup>
// Get a pinia store from a state.
const stateStore = useStateStore(state);
// Retreive some reactive values from the stores.
// See https://pinia.vuejs.org/core-concepts/#Destructuring-from-a-Store.
const { state } = storeToRefs(stateStore);
</script>useStateCollectionStore
import useStateCollectionStore from "@mobilizing/soundworks-plugin-vue-helpers/composables/use-state-colelction-store.js";
<script setup>
// Get a pinia store from a state collection.
const stateCollectionStore = useStateCollectionStore(stateCollection);
// Retreive some reactive values from the stores.
// See https://pinia.vuejs.org/core-concepts/#Destructuring-from-a-Store.
const { states } = storeToRefs(stateCollectionStore);
</script>Utils
deepRaw
import deepRaw from "@mobilizing/soundworks-plugin-vue-helpers/utils/deep-raw.js";
// Get a deep raw value from a Vue-created proxy.
// This is a deep version of Vue's toRaw.
// See https://vuejs.org/api/reactivity-advanced#toraw
const rawValue = deepRaw(value);Credits
This code has been written thanks to fundings from PSL Valorisation for the MobColl prematuration project program and the CPCFQ cooperation funds.
