Skip to content
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

Add note for onAdd's second param #149

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

francislavoie
Copy link
Contributor

Related to colyseus/schema#147

Currently, this second param is undocumented, I had to dig through github issues to find the solution for my problem.

This note might not be quite right, it assumes the TypeScript implementation. Do other langs behave the same, do they have the same 2nd param?

The fn signature should probably be mentioned in some way or another. And I think it should be mentioned that listen() can have this same problem it seems (causing a listen -> onAdd nesting to cause onAdd to still trigger multiple times if the data existed before the user joins the room).

@endel endel merged commit d93f173 into colyseus:master Dec 18, 2023
4 checks passed
@endel
Copy link
Member

endel commented Dec 18, 2023

Thank you so much for this @francislavoie 🎉
I added the signature as you suggested and described the default behaviour of second argument ("triggerAll" )

endel added a commit that referenced this pull request Dec 18, 2023
@francislavoie francislavoie deleted the patch-2 branch December 18, 2023 19:09
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.

2 participants