jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

Handle renderer switches better in boardgame-component-stack #555

Open jkomoros opened 6 years ago

jkomoros commented 6 years ago

Originally captured in #476

After 35b16c9 , when you switch from one renderer to another type (e.g. from memory to a debug animations game) the very first time the stacks render they don't have access to the deck defaults, and newComponent returns null--so there have to always be checks for it returning null. Then later when the defaults are available it all databinds correctly (how?)

But that feels like a kludge--there seems like there should be a cleaner approach by better understanding the timing

jkomoros commented 5 years ago

1f109acb86b9bb87c1901e90557a97de2168cd34 is likely referencing this underlying issue, mitigating it somewhat via a hack. (Ideally they'd respond OK to that first render and not need a hard reset like 1f109acb86b9bb87c1901e90557a97de2168cd34 does)