Skip to content

Commit

Permalink
trigger on update whenever a component is updated (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxence-charriere committed Jan 15, 2024
1 parent 8256c2c commit 200b16d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/app/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,9 @@ func (m nodeManager) updateComponent(ctx Context, v, new Composer) (UI, error) {
return v, nil
}

if updater, ok := v.(Updater); ok {
updater.OnUpdate(ctx)
}
// if updater, ok := v.(Updater); ok {
// updater.OnUpdate(ctx)
// }

ctx.removeComponentUpdate(v)
return m.UpdateComponentRoot(ctx, v)
Expand All @@ -549,6 +549,10 @@ func (m nodeManager) updateComponent(ctx Context, v, new Composer) (UI, error) {
func (m nodeManager) UpdateComponentRoot(ctx Context, v Composer) (UI, error) {
ctx = m.context(ctx, v)

if updater, ok := v.(Updater); ok {
updater.OnUpdate(ctx)
}

root := v.root()
newRoot, err := m.renderComponent(v)
if err != nil {
Expand Down

0 comments on commit 200b16d

Please sign in to comment.