-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
fix: Remove lastSeenAt from useCollaborateData.tsx staleness check #4461
fix: Remove lastSeenAt from useCollaborateData.tsx staleness check #4461
Conversation
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
if (Array.isArray(obj)) { | ||
return obj.map(value => omitUnwantedData(value, field)); | ||
} else if (typeof obj === 'object' && obj !== null) { | ||
const result: any = {}; |
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.
Any particular reason we're declaring the result object as const, as even though const Object and Arrays are mutable, but ideally should be declared as let/var when we're going to update/modify them as we do with other datatypes
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.
When you declare a variable with const, it means that the variable itself cannot be reassigned to a new value. However, if the variable refers to an object or array, you can still modify the properties or elements within that object or array. The const keyword doesn't make the object itself immutable, just the variable reference.
Using const is often encouraged when a variable is not going to be reassigned because it communicates the intent more clearly and helps to prevent unintentional reassignments that could lead to bugs.
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.
We need to add types and tests
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
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.
nice
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
Signed-off-by: andreas-unleash <andreas@getunleash.ai>
# Conflicts: # frontend/cypress/integration/import/import.spec.ts
Remove the lastSeenAt property when checking for stale data