h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 327 forks source link

fix: Update plot color in theme_generator.py #1971 #1972

Closed marek-mihok closed 1 year ago

marek-mihok commented 1 year ago

This PR fixes a bug introduced by this commit where plot listens only for meta.theme changes but not for meta.themes when updating colors.

https://github.com/h2oai/wave/assets/23740173/fa4a85cf-aa13-4dea-86ed-1bdcdb721299

Closes #1971

marek-mihok commented 1 year ago

themeWatchRef.current = on(themeB, themesB, () => {

This is what I was looking for! Thanks, @mturoci . I must have overlooked somehow that the on handler supports subscription to multiple boxes.

/** Subscribe to changes in 2 Boxes. */
export function on<A, B>(a: Box<A>, b: Box<B>, f: Eff2<A, B>): Disposable;

Done.