maxence-charriere / go-app

A package to build progressive web apps with Go programming language and WebAssembly.
https://go-app.dev
MIT License
7.75k stars 354 forks source link

state broadcast refactor #943

Closed maxence-charriere closed 2 months ago

maxence-charriere commented 2 months ago

state broadcast now requires for an observer to specify that it also observer broadcasts.

Usage:

var v int
ctx.ObserveState("stateName", &v).
    WithBroadcast()

This is to not create a BroadcastChannel by default when there is no state broadcast required. This will prevent

Screenshot 2024-03-21 at 4 15 16 PM