Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use explicit type definitions for entity configuration (#40995)
Add Entity configuration types to core-data/src/entities.ts for the selector types to lean upon in the upcoming PR. Writing the kind and name twice is a trade-off. I've spent hours exploring the available options with @dmsnell and we concluded that it's only possible to either: * Infer it from the config and miss out on autocompletion, config type validation, and require using as const. Reuse the JS entities configuration in the TypeScript type system #40024 explored that * Infer it from the config and have all of the above, but at the cost of using super complex type plumbing. This TS playground explores that * Type it explicitly, have autocompletion and type validation without complex types, but duplicate a few lines of code. This commit implements the latter approach.
- Loading branch information