Skip to content

Commit

Permalink
🐛 Fixed a bug where setting multiple selectors would wipe previous ones.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayleigh-dot-dev committed Sep 21, 2024
1 parent 7e4d5bb commit 1ccccce
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/lustre/internals/runtime.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,15 @@ fn loop(
actor.continue(next)
}

SetSelector(selector) ->
actor.Continue(
state,
Some(
state.selector
|> process.merge_selector(process.map_selector(selector, Dispatch)),
),
)
SetSelector(selector) -> {
let new_selector =
process.merge_selector(
state.selector,
process.map_selector(selector, Dispatch),
)

actor.Continue(State(..state, selector: new_selector), Some(new_selector))
}

Shutdown -> actor.Stop(process.Killed)
}
Expand Down

0 comments on commit 1ccccce

Please sign in to comment.