@farhanmansuri/ignite-vue
v2.0.0
Published
Vue 3 composable for Ignite — pre-warms serverless functions on hover intent
Downloads
129
Maintainers
Readme
@farhanmansuri/ignite-vue
Vue 3 composable for Ignite -- eliminates serverless cold starts by pre-warming functions on hover intent.
Install
npm install @farhanmansuri/ignite-vue @farhanmansuri/ignite-coreUsage
Register the plugin, then use useIgnite in any component:
// main.ts
import { createApp } from 'vue';
import { createIgnitePlugin } from '@farhanmansuri/ignite-vue';
const app = createApp(App);
app.use(createIgnitePlugin({
serverBaseURL: 'https://us-central1-myapp.cloudfunctions.net',
}));<template>
<button @mouseenter="onMouseEnter" @mouseleave="onMouseLeave" @click="submit">
Create Project
</button>
</template>
<script setup lang="ts">
import { useIgnite } from '@farhanmansuri/ignite-vue';
const { onMouseEnter, onMouseLeave } = useIgnite('createProject');
</script>When the user hovers for 150ms, a warm signal fires. By the time they click, the function is already warm.
