-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically set change detection for traits that are being observed #16
Comments
Looks good. Yeah I think entity + trait can be an implementation detail eventually. Since the public listening API requires you to pass an Entity in all cases anyway (unless I'm missing some?). Storing the tuple (trait, entity) in the tracking list should greatly reduce the number of comparisons and thus improve perf, making |
Only the React API makes you pass in an entity. The core API does not (onChange) and neither does tracking queries using the Changed modifier. |
I see. Okay let's put that discussion in another issue, since this is pretty much agreed on. |
Implemented with #38 |
Right now change detection is set per
updateEach
call manually, default off. The proposal is to make change detection beon
,off
, orauto
instead of a boolean, with default beingauto
. Ifauto
then it would follow these rules:onChange
are added to a tracking list.auto
tooff
.There was suggestion to make this even more specific, per entity per trait. There is no API for that currently (you can observe all entities for a given trait, not specific entities, and then filter for specific entities) so this should be opened as another issue.
The text was updated successfully, but these errors were encountered: