@farhanmansuri/ignite-svelte
v2.0.0
Published
Svelte action for Ignite — pre-warms serverless functions on hover intent
Maintainers
Readme
@farhanmansuri/ignite-svelte
Svelte action for Ignite -- eliminates serverless cold starts by pre-warming functions on hover intent.
Install
npm install @farhanmansuri/ignite-svelte @farhanmansuri/ignite-coreUsage
Set config in a parent component, then use the ignite action:
<!-- App.svelte -->
<script>
import { setIgniteConfig } from '@farhanmansuri/ignite-svelte';
setIgniteConfig({
serverBaseURL: 'https://us-central1-myapp.cloudfunctions.net',
});
</script>
<slot /><!-- CreateProject.svelte -->
<script>
import { ignite } from '@farhanmansuri/ignite-svelte';
</script>
<button use:ignite={{ functionName: 'createProject' }} on:click={handleSubmit}>
Create Project
</button>When the user hovers for 150ms, a warm signal fires. By the time they click, the function is already warm.
