@@ -25,28 +25,22 @@ To create a store:
2525
2626<RTKCodeSnippet id = " web-react" >
2727
28- ``` ts
29-
28+ ``` ts
3029const stores = useRealtimeKitSelector ((m ) => m .stores );
3130const store = stores .create (' myStore' );
32-
3331````
3432< / RTKCodeSnippet >
3533< RTKCodeSnippet id = " web-angular" >
3634
37- ` ` ` ts
38-
35+ ` ` ` ts
3936const store = meeting.stores.create('myStore');
40-
4137` ` ` `
4238
4339</RTKCodeSnippet>
4440<RTKCodeSnippet id="web-web-components">
4541
46- ` ` ` ts
47-
42+ ` ` ` ts
4843const store = meeting .stores .create (' myStore' );
49-
5044````
5145< / RTKCodeSnippet >
5246
@@ -129,10 +123,11 @@ For example, if the stored value is `['a', 'b']` and you call `update` with `['c
129123You can attach event listeners on a store's key, which fire when the value changes.
130124
131125<RTKCodeSnippet id = " web-react" >
126+
132127``` ts
133128const stores = useRealtimeKitSelector ((m ) => m .stores .stores );
134129const store = stores .get (' myStore' );
135- store .subscribe (' key' , (data ) => {
130+ store .subscribe (' key' , (data ) => {
136131 console .log (data );
137132});
138133
@@ -142,12 +137,12 @@ console.log(data);
142137});
143138
144139store .unsubscribe (' key' );
145-
146140````
147141
148142< / RTKCodeSnippet >
149143
150144< RTKCodeSnippet id = " web-angular" >
145+
151146` ` ` ts
152147const { stores } = meeting.stores;
153148const store = stores.get('myStore');
@@ -167,10 +162,11 @@ store.unsubscribe('key');
167162</RTKCodeSnippet>
168163
169164<RTKCodeSnippet id="web-web-components">
165+
170166` ` ` ts
171167const { stores } = meeting .stores ;
172168const store = stores .get (' myStore' );
173- store .subscribe (' key' , (data ) => {
169+ store .subscribe (' key' , (data ) => {
174170 console .log (data );
175171});
176172
@@ -180,7 +176,6 @@ console.log(data);
180176});
181177
182178store .unsubscribe (' key' );
183-
184179````
185180
186181< / RTKCodeSnippet >
@@ -190,6 +185,7 @@ store.unsubscribe('key');
190185You can fetch the data stored in the store :
191186
192187< RTKCodeSnippet id = " web-react" >
188+
193189` ` ` ts
194190const stores = useRealtimeKitSelector((m) => m.stores.stores);
195191const store = stores.get('myStore');
@@ -204,6 +200,7 @@ const data = store.getAll();
204200</RTKCodeSnippet>
205201
206202<RTKCodeSnippet id="web-angular">
203+
207204` ` ` ts
208205const { stores } = meeting .stores ;
209206const store = stores .get (' myStore' );
@@ -220,6 +217,7 @@ const data = store.getAll();
220217
221218
222219< RTKCodeSnippet id = " web-web-components" >
220+
223221` ` ` ts
224222const { stores } = meeting.stores;
225223const store = stores.get('myStore');
0 commit comments