let app = createApp initModel view update renderer
start app // warning here
The last line produces a compiler warning saying "This is a function value, you're probably missing an argument". This is because the start function returns not unit, but another function of type AppMessage<_,_> -> unit. This is apparently not an idle mistake, but is used in DevTools, as pointed out by @mastoj.
The proposed fix is to have two flavors of start - one returning the message intake function, and one returning unit:
// use this for devTools and other similar clever things
let startAndExposeMessageSink ... =
// the contents of today's `start` goes here
// use this for normal apps written by mere mortals
let start ... =
startAndExposeMessageSink ... |> ignore
The last line produces a compiler warning saying "This is a function value, you're probably missing an argument". This is because the
start
function returns notunit
, but another function of typeAppMessage<_,_> -> unit
. This is apparently not an idle mistake, but is used in DevTools, as pointed out by @mastoj.The proposed fix is to have two flavors of
start
- one returning the message intake function, and one returningunit
: