Open apiv opened 6 years ago
It would be great to have redux-capacitor "lazy-load" entities when accessing them via a relationship for the first time.
As much as I understand redux-capacitor, currently it is required to explicitly fetch entities before it is possible to access them. E.g. in demo-redux-capacitor, some person's homeworld must first be fetched before it can be shown ( https://github.com/contactually/demo-redux-capacitor/blob/9087796c97638b908e8db556ad52ff50c4d6f76d/src/ConnectedPeople.js#L22 ).
Could we envision to have redux-capacitor automatically fetch entities when navigating the entity graph, i.e. when accessing an entity's relationship?
See https://github.com/paularmstrong/normalizr/issues/267
If a normalized record looks like this...
...And
bucket_2
has not yet been fetched, the denormalized result for this contact will be:This isn't a problem in our app yet, since we always return nested resources. When we start optimizing performance and implementing sparse fields support, this will need to be handled.