Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nihalbhatnagar
Copy link
Contributor

Screen.Recording.2024-10-17.at.9.06.04.AM.mov

routeId: object.object.routeId ?? entityInfo[primaryKey].routeId,
nextStopId: object.object.nextStopId
?? entityInfo[primaryKey].nextStopId,
});
Copy link
Contributor Author

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
>({});
Copy link
Contributor Author

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.

Copy link
Contributor Author

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) {

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants