Skip to content

Commit d64610a

Browse files
committed
docs: Update docs-site pages to align with README source of truth
- Update registration examples to use AddStoreWithUtilities - Add persistence example to Todo List - Update library size information (38 KB gzipped) - Ensure all code examples follow recommended patterns - Add comments to clarify registration approach
1 parent 93a8a58 commit d64610a

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

docs-site/src/pages/Examples.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public record CounterState(int Count, string? LastAction = null)
2323
}`;
2424

2525
const counterProgramCode = `// Program.cs
26-
builder.Services.AddStore(
26+
// Recommended - All-in-one registration with utilities + async executor
27+
builder.Services.AddStoreWithUtilities(
2728
new CounterState(0),
2829
(store, sp) => store.WithDefaults(sp, "Counter")
2930
);`;
@@ -123,9 +124,11 @@ public record TodoState(
123124
}`;
124125

125126
const todoProgramCode = `// Program.cs
126-
builder.Services.AddStore(
127+
builder.Services.AddStoreWithUtilities(
127128
new TodoState(),
128-
(store, sp) => store.WithDefaults(sp, "Todo")
129+
(store, sp) => store
130+
.WithDefaults(sp, "Todo")
131+
.WithPersistence(sp, "todos") // Auto-save to LocalStorage
129132
);`;
130133

131134
const todoComponentCode = `// TodoList.razor

docs-site/src/pages/GettingStarted.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ builder.Services.AddStoreWithUtilities(
9393

9494
<Alert type="info" title="Prerequisites">
9595
<ul style={{ margin: 0, paddingLeft: '1.5rem' }}>
96-
<li>.NET 8.0 or higher</li>
97-
<li>Blazor Server or WebAssembly project</li>
96+
<li><strong>Requirements:</strong> .NET 8.0+ • Blazor Server or WebAssembly • <strong>38 KB</strong> gzipped (less than a logo image!)</li>
9897
<li>Basic understanding of C# records and LINQ</li>
9998
</ul>
10099
</Alert>

docs-site/src/pages/Home.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const Home = () => {
1818
this with { Count = 0, LastAction = "Reset" };
1919
}`;
2020

21-
const registrationExample = `// Simple - with default setup (DevTools + Logging)
22-
builder.Services.AddStore(
21+
const registrationExample = `// One-liner registration with all features
22+
builder.Services.AddStoreWithUtilities(
2323
new CounterState(0),
2424
(store, sp) => store.WithDefaults(sp, "Counter"));`;
2525

0 commit comments

Comments
 (0)