@@ -6,12 +6,12 @@ next.js'
6
6
---
7
7
8
8
In v6 we introduced a few minor breaking changes, which were mostly necessary for better support of
9
- next.js (and server side rendering in general).
9
+ next.js (and server- side rendering in general).
10
10
11
11
## Updates to cache
12
12
13
- Cache no longer returns records as maps.
14
- All methods interacting with cache are now returning plain objects instead of ` Map ` .
13
+ The cache no longer returns records as maps.
14
+ All methods interacting with the cache are now returning plain objects instead of ` Map ` .
15
15
16
16
``` ts
17
17
tolgee .loadRecords (): Promise < CacheInternalRecord []>
@@ -32,15 +32,15 @@ type CacheInternalRecord = {
32
32
33
33
## Updated ` getRequiredRecords `
34
34
35
- This function was renamed to ` getRequiredDescriptors ` , because it's not returning data from cache,
36
- but description (descriptors) of what need to be in cache. Previous name was confusing.
35
+ This function was renamed to ` getRequiredDescriptors ` , because it's not returning data from the cache,
36
+ but description (descriptors) of what needs to be in cache. The previous name was confusing.
37
37
38
38
``` ts
39
39
tolgee .getRequiredDescriptors (lang ?: string , ns ?: NsFallback ): CacheDescriptorInternal []
40
40
```
41
41
42
- Previously the method returned the descriptors that are missing in the cache, but now we are returning
43
- all records that are required to be in the cache, so it works the same regardless what is currently in cache.
42
+ Previously the method returned the descriptors that were missing in the cache, but now we are returning
43
+ all the missing records regardless of what is currently in the cache.
44
44
45
45
Previous behavior can be achieved by comparing the cache content with the results of this function.
46
46
@@ -62,14 +62,14 @@ You can replace that with `update` event.
62
62
tolgee .on (' update' , ... )
63
63
```
64
64
65
- If you want to only react to certain namespaces, the event handler recieves an array of events which
66
- led to invocation of ` update ` event (` update ` is derrived from other events).
65
+ If you only want to react to certain namespaces, the event handler receives an array of events which
66
+ led to the invocation of ` update ` event (` update ` is derived from other events).
67
67
68
68
``` ts
69
69
tolgee .on (' update' , (events ) => {
70
70
if (events .every (e => (e .type !== ' cache' || e .value .namespace === ' namespace' ))) {
71
71
handler ()
72
- }
72
+ }
73
73
})
74
74
```
75
75
90
90
91
91
## Vue
92
92
93
- `TolgeeProvider` ssr interface is now same as the react one.
93
+ `TolgeeProvider` ssr interface is now the same as the react one.
94
94
95
95
Old:
96
96
```html
0 commit comments