-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: Add shared objects to embed-widget #2189
base: main
Are you sure you want to change the base?
Conversation
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.
Need to clean up a few things.
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.
Need to clean up a few things.
); | ||
|
||
const isLoaded = | ||
(definition != null || sharedObject != null) && error == null; | ||
const isLoading = definition == null && sharedObject == null && error == null; | ||
(definition != null || sharedReady != false) && error == 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.
(definition != null || sharedReady != false) && error == null; | |
(definition != null || sharedReady) && error == null; |
(definition != null || sharedObject != null) && error == null; | ||
const isLoading = definition == null && sharedObject == null && error == null; | ||
(definition != null || sharedReady != false) && error == null; | ||
const isLoading = definition == null && sharedReady == false && error == 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.
const isLoading = definition == null && sharedReady == false && error == null; | |
const isLoading = definition == null && !sharedReady && error == null; |
type ConnectionWithGetSharedObject = dh.IdeConnection & { | ||
getSharedObject(name: string, type: string): Promise<unknown>; | ||
}; | ||
|
||
function isConnectionWithGetSharedObject( | ||
connection: dh.IdeConnection | ||
): connection is ConnectionWithGetSharedObject { | ||
return ( | ||
'getSharedObject' in connection && | ||
typeof connection.getSharedObject === 'function' | ||
); | ||
} |
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.
Move the type definition and typePredicate outside of/above this functional component.
} | ||
throw new Error( | ||
'Connection does not have getSharedObject method. Cannot fetch shared object.' | ||
); | ||
} | ||
if (definition != 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.
I'd personally put the definition != null
case first.
Requires deephaven/deephaven-core#5854
Adds ability to fetch shared objects with
embed-widget
.name
takes the shared ticket, thenshared
specifies the type of shared object that needs to be fetched, which is required forgetSharedObject
.