Commit 6d46ac4
authored
fix(data): type overloaded add for is optimistic true | undefined (#2906)
TypeScript only recognizes the overloads as method signatures when being overloaded not the actual implementation, added overload for the case where isOptimistic is true or undefined (default for entity).
This will allow for the following:
`.add(entityWithoutId, { isOptimistic: false })`
`.add(entityWithId, { isOptimistic: true })`
`.add(entityWithId, { // any other options without whatever settings and no explicit value for isOptimistic })`
`.add(entityWithId)`1 parent 9c54bfb commit 6d46ac4
File tree
1 file changed
+5
-1
lines changed- modules/data/src/entity-services
1 file changed
+5
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
0 commit comments