| Category | State |
|---|---|
| Export Size | 213 B |
| Last Changed | last month |
| Related | createGlobalState |
Make a composable function usable with multiple Vue instances.
import { createSharedComposable, useMouse } from '@vueuse/core'
const useSharedMouse = createSharedComposable(useMouse)
// CompA.vue
const { x, y } = useSharedMouse()
// CompB.vue - will reuse the previous state and no new event listeners will be registered
const { x, y } = useSharedMouse()
/** * Make a composable function usable with multiple Vue instances. * * @see https://vueuse.org/createSharedComposable */ export declare function createSharedComposable<Fn extends AnyFn>( composable: Fn ): Fn
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/shared/createSharedComposable/