Releases: aulisius/pandora
Releases · aulisius/pandora
v2.0.0
@faizaanceg/pandora v2.0.0
A new release of @faizaanceg/pandora is here, featuring a powerful Subscriptions API and improvements to the KeyValueStore.
New: Subscriptions API
You can now subscribe to changes on individual keys:
import KV from "@faizaanceg/pandora";
const unsubscribe = KV.subscribe("my-key", () => {
console.log("User changed:", KV.get("my-key"));
});
unsubscribe(); // Removes the listener- Supports multiple listeners per key
- Returns a cleanup function to unsubscribe
- Listeners are triggered when the key’s value is updated
This makes the store more reactive and integration-friendly in dynamic applications.
💾 KeyValueStore Overview
get(key, defaultValue?)– Read a key with optional fallbackset(key, value, { ttl, shouldPersist })– Store values with TTL and/or persistenceremove(key)– Remove a specific keyclear(force?)– Clear all or only non-persistent entriesgetSnapshot()– Return a snapshot of the current state