hoist-react
hoist-react copied to clipboard
Support `Store` generic types to spec types for `StoreRecord.data` and `StoreRecord.id`
It would be excellent if we could spec an interface for the data element of all records within a given Store
, so you would have type-aware support when reading their data in code.
Have not thought it through in detail, but I am assuming StoreRecord
would take a generic and then Store
, GridModel
, etc. would have some way to pass it though. And of course it would need to come out the other side of a variety of StoreRecord
-emitting APIs. But I believe it would be a big win, given how common it is to pass records around through an application.
Being able to tell TS that your id
s will be either numbers or strings (as opposed to either) could also eliminate some common boilerplate casting.