Giter VIP home page Giter VIP logo

Comments (8)

Cxxshyy avatar Cxxshyy commented on September 28, 2024

can look at this as well with guidance#

from dwn-sdk-js.

thehenrytsai avatar thehenrytsai commented on September 28, 2024

Haven't thought too deeply about this, but the reason behind filing this issue was seeing many instances of the DID resolver passing down from DWN construction to a lot of classes. But not passing it down also has the downside of hiding this dependency, making it not obvious that the DID resolver is a critical dependency... so I have not made up my mind to know if this is really a good direction. So I am going to take this off the "good first issue" list.

But it is not too difficult to implement, an approach to implement this would be:

  1. Create a singleton instance in did-resolver.
  2. Reference the singleton resolver wherever DID resolver is used.
  3. Allow setting of the singleton instance for ease of testing.

from dwn-sdk-js.

Cxxshyy avatar Cxxshyy commented on September 28, 2024

i understand the first 2 i think but not the last one what does it mean?

from dwn-sdk-js.

thehenrytsai avatar thehenrytsai commented on September 28, 2024

I meant to say "allow updating/changing the singleton instance so tests can mock it.

from dwn-sdk-js.

Cxxshyy avatar Cxxshyy commented on September 28, 2024

ok also i cant see where the Didresolver first gets instantiated in the file because from what i can see other files just import the clas and do '''didResolver: DidResolver'''

from dwn-sdk-js.

thehenrytsai avatar thehenrytsai commented on September 28, 2024

It is first injected through the Dwn constructor, then passed down in a cascading fashion.

from dwn-sdk-js.

Cxxshyy avatar Cxxshyy commented on September 28, 2024

ok just to make sure you mean every occurrence of image i just change to a getInstance method from the singleton

from dwn-sdk-js.

thehenrytsai avatar thehenrytsai commented on September 28, 2024

Super low pri now, can always reopen if this becomes an issue.

from dwn-sdk-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.