@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);
};
  • PulseProvider publishes one Pulse to the components below and follows a new pulse prop. 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

@vizejs/composable

Lifecycle-safe composable foundations for Vize applications

22,849 908
@vt7/vue2-composables

Vue2 composables

592 1
@shopware/composables

Shopware Frontends composables for Vue

141,216 230
@tb-dev/vue

Vue utilities

12,617
vue-videobg

Video Background component for Vue.js

4,724 245

Version History

Version Released Vue License
0.1.0 >=3.5.0 <4 MIT