Skip to content

Conversation

@TheyCallMeRyan
Copy link

Proposed changes

Has queryChanged create a proxy for each component, allowing each world to get its own unique hookState from useHookState

Related issues

Primarily intended to solve: #155
Has a side-effect of solving: #147 since clearing the proxies will clear the queryChanged storage.

Additional comments

I had an alternate solution initially where I created the local world storage based on the hookState, but I think that resulted in a far messier solution. TheyCallMeRyan@cb39966
Both solutions fix both issues though.

Each world has a unique component proxy allowing queryChanged to get its own pristine hookStorage in each world.
@TheyCallMeRyan
Copy link
Author

Might be worth noting for issue 147 - the warning in the docs that removing entities with world:clear() won't be reported by queryChanged is still valid; this just makes it so the world can still be used afterwards and perform as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant