Open muuvmuuv opened 1 month ago
Could you please elaborate the use case why these types are required over Update<T>
?
We put in some models directly that come from our API, these have strings as their ID. To not always call .toString()
it would be nice to directly say UpdateStr. TypeScript will always complain about it when doing stuff like entry.id === id
, because it could be a number.
function patchEntryAndChildrens(entry: Update<Entry>) {
// ... update
const children = state.filter(e => e.parentId === entry.id.toString()) // id/parentId are strings
}
Which @ngrx/* package(s) are the source of the bug?
entity
Minimal reproduction of the bug/regression with instructions
Does not work:
import { UpdateStr } from '@ngrx/entity'
Works but errors:import { UpdateStr } from '@ngrx/entity/src/models'
Expected behavior
Export it like
Update
.Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)
Just updated to latest
Other information
No response
I would be willing to submit a PR to fix this issue