matter-ecs / matter-hooks Goto Github PK
View Code? Open in Web Editor NEWA hooks library for Matter
Home Page: https://matter-ecs.github.io/matter-hooks/
License: MIT License
A hooks library for Matter
Home Page: https://matter-ecs.github.io/matter-hooks/
License: MIT License
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.
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.
One alternative is to have a similar implementation to what is provided in the matter docs.
https://eryn.io/matter/docs/Guides/CollectionService
useMemo appears not to work.
Steps to reproduce the behavior:
My (far from minimal) repro: umdbg.zip
The callback should only run โ and print โ once.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.