Git Product home page Git Product logo

Comments (4)

karcreativeworks avatar karcreativeworks commented on May 29, 2024 1

Maybe this will help you -> https://github.com/TheMoonDevs/DApp-Reacthooks.

Remember these are just snippets, and you should copy/paste and edit them to fit your needs.

from use-metamask.

mdtanrikulu avatar mdtanrikulu commented on May 29, 2024

Hi thank you for your nice words! I would love to see more technical information about clogging part. Context component should not cause any clogging unless you call useContext hook on main app without any memoization strategy.

from use-metamask.

hems avatar hems commented on May 29, 2024

Hi thank you for your nice words! I would love to see more technical information about clogging part. Context component should not cause any clogging unless you call useContext hook on main app without any memoization strategy.

sorry i think "clogging" isn't the right word, but what i meant is that i have to wrap the app with a MetamaskStateProvider tag so if i would use let's say 10-15 hooks similar to this on my app, my app tree would end up being wrapped by 15 providers...

considering all the MetaMask information is a "singleton" ( i.e. unique state globally available state on the window ) i wonder why can't we just wrap all the logic on the hook itself and avoid having to wrap the app in a Provider tag... ?

Does that make sense?

from use-metamask.

hems avatar hems commented on May 29, 2024

Maybe this will help you -> https://github.com/TheMoonDevs/DApp-Reacthooks.

Remember these are just snippets, and you should copy/paste and edit them to fit your needs.

interesting, this indeed works in a similar way to what i envisioned.. the hooks are self contained and don't require a context wrapper.

i'll let you know if i end up modifying coming up with something different.

from use-metamask.

Related Issues (19)

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.