Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Version 3.1.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@CRBroughton CRBroughton released this 30 May 17:42
· 3 commits to develop since this release
5520b75

New included snippets are listed below:

v3store

import type { InjectionKey } from 'vue'
import { inject, provide } from 'vue'

const store = () => {}

const storeKey: InjectionKey<ReturnType<typeof store>> = Symbol('composition-store')

export const provideStore = () => {
    const state = store()
    provide(storeKey, state)
    return state
}

export const useStore = () => {
    return inject(storeKey)!
}