edges-svelte 0.5.7 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@ No context boilerplate. No hydration headaches. Just drop-in SSR-compatible stat
8
8
 
9
9
  - 🔄 Unified state for server and client
10
10
  - 🧠 Persistent per-request memory via `AsyncLocalStorage`
11
- - 💧 Tiny API — no subscriptions needed unless you want them
11
+ - 💧 Tiny API
12
12
  - 💥 Instant serialization without magic
13
13
  - 🧩 Provider-based dependency injection, zero runtime overhead
14
14
 
@@ -119,7 +119,15 @@ import { createProvider } from 'edges-svelte';
119
119
  const myProvider = createProvider({
120
120
  cacheKey: 'MyUniqueProviderName',
121
121
  factory: ({ createState }, params) => {
122
- const userData = createState('userData', () => fetchUserData(params.userId));
122
+ const myService = new MyService();
123
+ const someData = createState('userData', () => undefined);
124
+
125
+ const setUserData = async () => {
126
+ await myService.getData().then((user) => {
127
+ userData.set(user);
128
+ });
129
+ };
130
+
123
131
  return { userData };
124
132
  }
125
133
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edges-svelte",
3
- "version": "0.5.7",
3
+ "version": "0.6.0",
4
4
  "license": "MIT",
5
5
  "author": "Pixel1917",
6
6
  "description": "A blazing-fast, extremely lightweight and SSR-friendly store for Svelte",