-
Notifications
You must be signed in to change notification settings - Fork 2
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!: getExtensions isn't a promise #11
Conversation
935f46e
to
1aa1d74
Compare
src/getExtension/getExtension.ts
Outdated
// copy all extensions into a new object since the caller should be allowed to change the object | ||
// without changing the underlying extension object. | ||
return { ...apiWindow.kilt } |
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 am surprised to see this requirement. This will also likely lose the very special versions property. I’d rather simply return the kilt object.
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.
src/getExtension/getExtension.ts
Outdated
* If an extension injects itself only after this function is called, it will not be contained in the returned extensions. | ||
* @returns an object containing extensions | ||
*/ | ||
export function getExtensions(): Record<string, InjectedWindowProvider<PubSubSessionV1 | PubSubSessionV2>> { |
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.
Can we get a type that includes all the PubSubSessions? That would also be interesting to export as well.
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.
You are referring to all started sessions with the extensions?
it's expected to get a list of extensions
related https://github.com/KILTprotocol/ticket/issues/2126
This PR changes the
getExtension
function.window.kilt
property)Future additions
we already dispatch the
kilt-dapp#initialized
even though it's not part of the Credential API 3.0.Once the events are part of the credential API we should include a function for listening to new extensions.