You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if your application model depends on the result of a task that can fail, you need to keep a Maybe on the model, because you have to call Node.startProgram with an instance of your model no matter what. If there was a way to explicitly not start the program, you could avoid the Maybe and fail directly in init. For example:
getSecureContext:TaskNever (MaybeCrypto.SecureContext)
getSecureContext =-- Turn fail-able task into one that always resolves. ...init env =Init.await getSecureContext <|\maybeSecureContext ->
when maybeSecureContext is
Nothing->Node.failToStart "Failed to get secure context."Just secureContext ->Node.startProgram
{ model ={ secureContext = secureContext -- don't need a Maybe...
Activity