You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They currently return a mutable POJO, but the problem is that many of its properties should really be computed as they depend on other properties. For example content.type is effectively this.layer.type || this.item.type.
We get into trouble when the dependent properties are set before their dependences. In the above example, for private items, we don't have this.layer for private items until we've fetched the server info, so we need to remember to update type an anything else that depends on layer, or the updated type, and so on. This has been the cause of a few sublte bugs.
See #667 (comment) for a description of how that PR introduced seter functions to mitigate such bugs.
If we stick w/ the current functional approach, it may be an improvement to make the returned POJOs immutable using something like deepFreeze. We are already trying to treat them as such since many
The text was updated successfully, but these errors were encountered:
They currently return a mutable POJO, but the problem is that many of its properties should really be computed as they depend on other properties. For example
content.type
is effectivelythis.layer.type || this.item.type
.We get into trouble when the dependent properties are set before their dependences. In the above example, for private items, we don't have
this.layer
for private items until we've fetched the server info, so we need to remember to updatetype
an anything else that depends onlayer
, or the updatedtype
, and so on. This has been the cause of a few sublte bugs.See #667 (comment) for a description of how that PR introduced
set
er functions to mitigate such bugs.If we stick w/ the current functional approach, it may be an improvement to make the returned POJOs immutable using something like deepFreeze. We are already trying to treat them as such since many
The text was updated successfully, but these errors were encountered: