@priemskiyyy/pulse-vue
Vue bindings for Pulse: a provider, and composables for the Pulse and its lifecycle state that observe without starting or disposing anything.
1
| Install | |
|---|---|
npm install @priemskiyyy/pulse-vue |
|
| Latest Version: | 0.1.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 3, 2026 |
| Links: | GitHub · npm |
Maintainer: priemskiyyy
@priemskiyyy/pulse-vue
Vue bindings for Pulse: a provider that publishes one Pulse, and composables that read it. They observe only: they never start, dispose or configure the Pulse.
Installation
pnpm add @priemskiyyy/pulse @priemskiyyy/pulse-vue
Requires Vue 3.5 or later.
Read the lifecycle
import { useLifecycle, usePulse } from "@priemskiyyy/pulse-vue";
import { computed, onScopeDispose } from "vue";
export const useRefreshOnForeground = (refresh: () => void) => {
const state = useLifecycle();
onScopeDispose(usePulse().value.on("foreground", refresh));
return computed(() => state.value.phase);
};
PulseProviderpublishes one Pulse to the components below and follows a newpulseprop. Start the Pulse at bootstrap; the provider never starts or disposes it.useLifecycle(source?)returns a read-only computed ref of the frozen{ phase, interaction }snapshot of the given source or the provider's Pulse. It reads unknown on the server and until mounted.usePulse()returns a computed ref of the provider's Pulse.
Without a provider, usePulse() and a sourceless useLifecycle() throw PulseError with INVALID_CONFIGURATION.
License
MIT
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.0 | >=3.5.0 <4 | MIT |