can-connect
can-connect copied to clipboard
Relationship problems with `withRelated` service layer. ~34
In bitballs, I load a game's data, which gets saved in localStorage. Then later, I load the same item "withRelated" data. I get the game's data without related data from localStorage. This breaks things.
One solution would be to include other params in .getData related caching. This would save two different versions of the same item's data. Another would be to say one request {id: 4, withData: ["stats"]} actually represents a superset of data, so save that. Another, more difficult, but awesome, solution would be to support relationships. This would be able to get stats for {gameId: 5}
I think Ref type would fix this, though we'd need to document how. I think the problem with ref type in this case is that there isn't a single property to get either the id or the referenced object.