
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@warpkit/data
Advanced tools
Reactive data fetching and caching client for WarpKit with Svelte 5 integration
Type-safe data fetching hooks for Svelte 5 with caching and event-driven invalidation.
bun add @warpkit/data
invalidateOn and enabled config// types.ts
declare module '@warpkit/data' {
interface DataRegistry {
user: { data: User };
monitors: { data: Monitor[] };
}
}
import { DataClient } from '@warpkit/data';
const client = new DataClient({
baseUrl: '/api',
keys: {
user: { key: 'user', url: '/user' },
monitors: { key: 'monitors', url: '/monitors', staleTime: 30000 }
}
});
<script lang="ts">
import { useQuery } from '@warpkit/data';
const monitors = useQuery({ key: 'monitors' });
</script>
{#if monitors.isLoading}
<Spinner />
{:else if monitors.isError}
<Error message={monitors.error.message} />
{:else}
{#each monitors.data as monitor}
<Monitor {monitor} />
{/each}
{/if}
<script lang="ts">
import { useMutation } from '@warpkit/data';
const createMonitor = useMutation({
mutationFn: async (input) => {
const res = await fetch('/api/monitors', { method: 'POST', body: JSON.stringify(input) });
return res.json();
},
onSuccess: () => warpkit.events.emit('monitor:created')
});
</script>
<button onclick={() => createMonitor.mutate({ name: 'New' })}>
Add Monitor
</button>
useData is a thin wrapper over useQuery that accepts call-site invalidateOn events and an enabled flag:
<script lang="ts">
import { useData } from '@warpkit/data';
const monitors = useData('monitors', {
invalidateOn: ['monitor:created', 'monitor:deleted'],
enabled: () => !!userId
});
</script>
Returns reactive query state: data, isLoading, isError, error, isSuccess, isRevalidating, refetch().
Same return shape as useQuery. Config accepts invalidateOn?: string[] and enabled?: boolean | (() => boolean).
Returns mutation state: mutate(), mutateAsync(), isPending, isSuccess, isError, error, data, reset().
Options:
baseUrl - API base URLcache - Cache provider (optional)keys - Data key configurationsonRequest - Request interceptorretryOn429 - Auto-retry on 429 (default: true)maxRetries - Max 429 retries (default: 3)FAQs
Reactive data fetching and caching client for WarpKit with Svelte 5 integration
We found that @warpkit/data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.