Open TimoGlastra opened 3 years ago
It makes for a (IMO) very cluncky API. E.g the following code
const retrievedCreds = await agent?.proofs?.getRequestedCredentialsForProofRequest( proof?.requestMessage?.indyProofRequest, undefined ) if (!retrievedCreds) { throw new Error('Retrieved creds not found') }
could be reduced to the following
const retrievedCreds = await agent.proofs.getRequestedCredentialsForProofRequest( proof?.requestMessage?.indyProofRequest, undefined )
if agent was always of type Agent.
Agent
I think we could throw an error in useAgent if it is not available yet? Or we make sure you can pass a uninitalized agent to the agent provider so the value is at least defined
useAgent
cc @JamesKEbert @NeilSMyers
It makes for a (IMO) very cluncky API. E.g the following code
could be reduced to the following
if agent was always of type
Agent
.I think we could throw an error in
useAgent
if it is not available yet? Or we make sure you can pass a uninitalized agent to the agent provider so the value is at least defined