Events for state changes (onChange and onMultiplayerChange)
leondre
This would allow users to create their own states inside any framework.
For example in SvelteKit you could use:
let player = writable<{state: string} | null>(null)
myPlayer().onChange((playerState)=>{
player.set(playerState)
})
In my example snippet of code, the onChange returns all set player states connected to the player.
This single function would eliminate the need of making states work for every framework manually. Currently there is 2 workaround, RPC calls and Polling. Polling is really an outdated method of getting up-to-date data from any source and setting up RPC calls is a hassle to setup compared to React.