Skip to content

Commit 752aa79

Browse files
authored
chore: 🔨 release 17.4.0 (#90)
* chore: 🔨 release 17.4.0
1 parent 9f45656 commit 752aa79

File tree

4 files changed

+48
-14
lines changed

4 files changed

+48
-14
lines changed

docs/docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ const config = {
117117
],
118118
},
119119
announcementBar: {
120-
id: '17.3.0',
121-
content: '<b>signalstory 17.3.0</b> has just been released 🥳',
120+
id: '17.4.0',
121+
content: '<b>signalstory 17.4.0</b> is out 🥳🥳🥳',
122122
backgroundColor: '#e35e75',
123123
textColor: '#091E42',
124124
isCloseable: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "signalstory-workspace",
3-
"version": "17.3.0",
3+
"version": "17.4.0",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

packages/signalstory/README.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Here's a snapshot of some notable highlights:
2323
&nbsp;Immutability on demand
2424
&nbsp;Rich plugin ecosystem
2525
&nbsp;Native IndexedDB support
26-
&nbsp;Granular Undo/Redo
26+
&nbsp;Transactional Undo/Redo
27+
&nbsp;Global State Snaphots and Rollbacks
2728
&nbsp;Devtools support
2829
&nbsp;Effect and Store status tracking
2930
&nbsp;Realtime store performance statistics
@@ -46,7 +47,7 @@ Here's a snapshot of some notable highlights:
4647
- 📦 Don't want to use a class for stores? - You don't have to.
4748
- 🛠️ Tired of debugging state changes in the console? - Enable redux devtools.
4849
- 🪄 Still want some good old logging magic? - Enable Store logger plugin
49-
- ⏳ Need to keep track of store history and perform undo/redo operations? - Enable the history plugin.
50+
- ⏳ Need to keep track of store history and perform undo/redo operations? - track the history.
5051
- 💾 Want to sync your state with local storage? - Enable the persistence plugin.
5152
- 🗄️ Need a more sophisticated store storage or building an offline app? - Use IndexedDB adapter
5253
- 📈 Need to get notified of whether your store is modified or currently loading? - Enable the Store Status plugin.
@@ -67,7 +68,8 @@ npm install signalstory
6768
```typescript
6869
import { produce } from 'immer';
6970

70-
// Fully immutable store class with immer.js for boosting immutable mutation performance
71+
// Immutable store class using immer.js for boosting immutable mutations
72+
@Injectable({ providedIn: 'root' })
7173
class BookStore extends ImmutableStore<Book[]> {
7274
constructor() {
7375
super({
@@ -76,11 +78,13 @@ class BookStore extends ImmutableStore<Book[]> {
7678
mutationProducerFn: produce,
7779
plugins: [
7880
useDevtools(),
79-
useStoreHistory(),
80-
useStorePersistence(),
81+
usePerformanceCounter(),
8182
useLogger(),
8283
useStoreStatus(),
83-
usePerformanceCounter(),
84+
useStorePersistence(
85+
configureIndexedDb({
86+
dbName: 'SharedDatabase',
87+
})),
8488
],
8589
});
8690

@@ -105,24 +109,34 @@ class BookStore extends ImmutableStore<Book[]> {
105109
}, 'Add Book To Collection');
106110
}
107111
}
112+
```
108113

109-
114+
```typescript
110115
// Encapsulated multi store query object
111116
export const BooksAndPublishersByAuthorInSwitzerlandQuery = createQuery(
112117
[BookStore, PublisherStore],
113118
(books, publishers, authorId: string) => {
114119
const booksFromAuthor = books.state().filter(x => x.author === authorId);
115-
const publishersInSwitzerland = publishers.state().filter(x => x.country === 'CH');
120+
const publishersInSwitzerland = publishers
121+
.state()
122+
.filter(x => x.country === 'CH');
116123

117124
return booksFromAuthor.map(book => ({
118125
book,
119-
publisher: publishersInSwitzerland.find(p => p.id === book.mainPublisherId),
126+
publisher: publishersInSwitzerland.find(
127+
p => p.id === book.mainPublisherId
128+
),
120129
}));
121130
}
122131
);
123132
// And then run it
124-
const query = myBookStore.runQuery(BooksAndPublishersByAuthorInSwitzerlandQuery, 'sapowski');
133+
const query = myBookStore.runQuery(
134+
BooksAndPublishersByAuthorInSwitzerlandQuery,
135+
'sapowski'
136+
);
137+
```
125138

139+
```typescript
126140
// Encapsulated effect object
127141
export const fetchBooksEffect = createEffect(
128142
'Fetch Books',
@@ -150,6 +164,26 @@ const initializedSignal = initialized(myBookStore); // true after initializing e
150164
const modifiedSignal = modified(myBookStore); // true after store update
151165
```
152166

167+
```typescript
168+
// Track history spanning multiple stores
169+
const tracker = trackHistory(50, store1, store2);
170+
171+
// Undo single commands
172+
store1.set({ value: 10 }, 'ChangeCommand');
173+
tracker.undo();
174+
175+
tracker.beginTransaction('Transaction Label');
176+
store1.set({ value: 42 }, 'ChangeCommand');
177+
store2.set({ value: 23 }, 'AnotherCommand');
178+
tracker.endTransaction();
179+
180+
// Undo both commands on store1 and store2 at once
181+
tracker.undo();
182+
183+
// Redo the whole transaction
184+
tracker.redo();
185+
```
186+
153187
## Sample Application
154188

155189
To set up and run the sample app locally, follow the steps below:

packages/signalstory/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "signalstory",
3-
"version": "17.3.0",
3+
"version": "17.4.0",
44
"description": "Signal-based state management for Angular that grows with your project. Explore a versatile toolbox with enriching plugins for developers at all levels.",
55
"publishConfig": {
66
"access": "public"

0 commit comments

Comments
 (0)