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).
Thank you so much for this @francislavoie 🎉
I added the signature as you suggested and described the default behaviour of second argument ("triggerAll" )
Related to https://github.com/colyseus/schema/issues/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 alisten -> onAdd
nesting to causeonAdd
to still trigger multiple times if the data existed before the user joins the room).