Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarfgp committed May 2, 2024
1 parent 1992e29 commit 080c33c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Fabulous/Runner.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ open System.Collections.Concurrent
// Runner is created for the component itself. No point in reusing a runner for another component

/// Create a new Runner handling the update loop for the component
type Runner<'arg, 'model, 'msg when 'msg : null>(getState: unit -> 'model, setState: 'model -> unit, program: Program<'arg, 'model, 'msg>) =
type Runner<'arg, 'model, 'msg when 'msg: null>(getState: unit -> 'model, setState: 'model -> unit, program: Program<'arg, 'model, 'msg>) =
let mutable _activeSubs = Sub.Internal.empty
let mutable _reentering = false
let mutable _stopped = false
Expand All @@ -23,9 +23,10 @@ type Runner<'arg, 'model, 'msg when 'msg : null>(getState: unit -> 'model, setSt
// In cases where you have a Component() which itself is in a Component(program) and a side effect happens in the inner component, the outer component will dispatch a message that is null
// So here we need make sure that we don't process null messages `ValueSome null`
let mutable lastMsg = ValueOption.ofObj(msg)

while not _stopped && lastMsg.IsSome do
let model = getState()

let newModel, cmd = program.Update(unbox lastMsg.Value, model)
let subs = program.Subscribe(newModel)

Expand Down

0 comments on commit 080c33c

Please sign in to comment.