@epikodelabs/streamix / vue/src/public-api / useScope
Function: useScope()
useScope<
T>(factory):T
Defined in: projects/libraries/streamix/vue/src/lib/useScope.ts:18
Creates a Streamix scope whose lifetime is tied to the current Vue effect scope.
Vue component setup() functions already run inside an effect scope, so the Streamix scope is disposed automatically when the component unmounts. The same behavior works inside an explicit effectScope().
Unlike React, Vue setup is not re-run on every render, so no memo/ref cache is needed here: the factory naturally runs once per composable invocation.
Type Parameters
T
T extends Scope<any>
Parameters
factory
() => T
Returns
T