- # Probably what you want.
- sub subscribe-deep($store, Str $id, @path, &cb, $widget) {
- $store.subscribe-with-callback(
- $id,
- -> $s { ($s.get-in(|@path) // Any).gist },
- &cb,
- $widget,
- );
- }
- # Then this on any widget that you want to watch a tree deeply
- subscribe-deep($store, 'sub-a', <a>, -> $ { rerender-a() }, $widget);