-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Subscribe Sandbox App #882
base: main
Are you sure you want to change the base?
Conversation
routeId: object.object.routeId ?? entityInfo[primaryKey].routeId, | ||
nextStopId: object.object.nextStopId | ||
?? entityInfo[primaryKey].nextStopId, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have multiple thoughts on this. This seems like the ideal way for a user to update their cache since the properties are coming back as | undefined
, and they can just fill in the blanks with what is already. Is it possible a user just does !
on the returned object, then they receive a reference update, and then it all breaks? I would like to hope that developers follow simple practices such as good handling here, do we need to account for those who won't? However, I am liking the decision we made to include reference updates alongside the rest of these as if you do have proper error handling AND you set up your cache in the right way, the best practice becomes clear. However, the second part of the AND is the bigger worry to me
|
||
const [objectCoordinates, setObjectCoordinates] = React.useState< | ||
ObjectCoordinatesMap | ||
>({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I separated these out, mainly so I could avoid potentially undefined properties. Users are definitely going to have to deal with this, and the best hope is that they're going to handle this in an optimal way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do I need to configure this?
deleteEntity(entityInfo[primaryKey]); | ||
} | ||
|
||
if (object.object.positionId != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually something more like event.bus.positionId in context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I should enforce better naming conventions since it's a sample app
Screen.Recording.2024-10-17.at.9.06.04.AM.mov