Giter VIP home page Giter VIP logo

matter-hooks's Introduction

Matter Hooks CI status Docs status

Matter Hooks is a Luau hooks library for Matter.

It provides access to useful hooks not included in with Matter.

Installation

Matter Hooks can be installed with Wally by including it as a dependency in your wally.toml file.

MatterHooks = "matter-ecs/[email protected]"

Migration

If you're currently using the scope lasttalon/matter-hooks, this is the same package. You can migrate by changing your wally.toml file to use the scope matter-ecs/matter-hooks.

If you have migrated to ecs-matter/matter, you should also upgrade to matter-ecs/[email protected] or newer. This version of Matter Hooks is compatible with the matter-ecs/matter package scope as a peer dependency.

Building

Before building, you'll need to install all dependencies using Wally.

You can then sync or build the project with Rojo. Matter Hooks contains several project files with different builds of the project. The default.project.json is the package build.

Contributing

Contributions are welcome, please make a pull request! Check out our contribution guide for further information.

Please read our code of conduct when getting involved.

License

Matter Hooks is free software available under the MIT license. See the license for details.

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  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.