A modern Svelte binding library for PluresDB with full Svelte 5 compatibility.
PluresDB is published to @plures/pluresdb on npm and is also available as a GitHub package. It provides a modern, graph-based database with real-time synchronization capabilities.
- Svelte 4 & 5 Compatible: Works with both store-based and runes-based reactivity
- Type-Safe: Full TypeScript support with proper types
- Action-Based: Modern Svelte actions for DOM binding
- Store-Based: Writable store implementation for reactive data
- Collection Support: Easy handling of PluresDB collections
npm install unumimport { PluresStore } from "https://deno.land/x/unum/mod.ts";<script>
import { PluresStore } from 'unum';
import PluresDB from '@plures/pluresdb';
const db = new PluresDB();
// Create a reactive store from PluresDB data
const nameStore = new PluresStore(db.get('profile').get('name'));
// Subscribe to changes
$: name = $nameStore;
// Update PluresDB data
function updateName() {
nameStore.set('New Name');
}
</script>
<input type="text" bind:value={$nameStore} />
<button on:click={updateName}>Update</button><script>
import { usePlures } from 'unum';
import PluresDB from '@plures/pluresdb';
const db = new PluresDB();
// Create a reactive state variable from PluresDB data
const { value: name } = usePlures(db.get('profile').get('name'));
</script>
<input type="text" bind:value={name} /><script>
import { plures, pluresList } from 'unum';
import PluresDB from '@plures/pluresdb';
const db = new PluresDB();
const users = db.get('users');
</script>
<!-- Simple binding -->
<input type="text" use:plures={db.get('profile').get('name')} />
<!-- List binding with template -->
<ul use:pluresList={users}>
<li data-plures-template="true">
<span name="name">User name</span>
<input type="text" name="email" placeholder="Email" />
</li>
</ul>PluresStore<T>(dbChain, options?): Create a Svelte store from a PluresDB chaincreatePluresStore<T>(dbChain, options?): Type-safe factory function
usePlures<T>(dbChain, options?): Create a reactive state from a PluresDB chain
plures: Action for binding PluresDB data to HTML elementspluresList: Action for handling collections of PluresDB data items
MIT