Coder Social home page Coder Social logo

matter-hooks's People

Contributors

lasttalon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

yuuwa0519

matter-hooks's Issues

Add useCollectionService to handle collection service tags

Problem

As someone who uses collection service tags a lot to mark instances to have certain component, I thought it may be useful to add useCollectionService hook to handle them.

The advantage of this is that unlike useEvent, this will also handle all the instances with tag already added, meaning you won't need to run same operation twice separately for existing instances and newly tagged instances.

Proposed solution

The implementation of this hook is quite identical to useStream since it both handles addition and removal of instance, except on different event. It also has to add instances with tag already added on initialization.

Alternatives

One alternative is to have a similar implementation to what is provided in the matter docs.
https://eryn.io/matter/docs/Guides/CollectionService

useMemo always recomputing

Description

useMemo appears not to work.

Steps to reproduce

Steps to reproduce the behavior:

  1. Prepare your Matter boilerplate.
  2. Register a system that uses useMemo with a constant in the dependencies table or an empty dependencies table, a constant in the discriminator, and a print in the callback.
  3. Observe the print being called each and every time without fail.

My (far from minimal) repro: umdbg.zip

Expected behavior

The callback should only run โ€” and print โ€” once.

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.