Minor correction to main class
This commit is contained in:
parent
e5c3802e92
commit
c502f2e1c9
@ -7,6 +7,7 @@ import sttp.client.impl.monix.FetchMonixBackend
|
||||
import org.scalajs.dom.document
|
||||
import scala.scalajs.js.annotation.JSImport
|
||||
import scalajs.js
|
||||
import outwatch.router.AppRouter
|
||||
|
||||
@JSImport("bootstrap/dist/css/bootstrap.min.css", JSImport.Namespace)
|
||||
@js.native
|
||||
@ -23,8 +24,8 @@ object BootstrapBundleJs extends js.Object
|
||||
object BlkDesignSys extends js.Object
|
||||
|
||||
object OutwatchApp extends BIOApp {
|
||||
val router = Router.router
|
||||
def app(el: Element) = for {
|
||||
|
||||
def app(el: Element, router: AppRouter[Task, Page]) = for {
|
||||
store <- router.store
|
||||
backend = FetchMonixBackend()
|
||||
} yield new MainApp(el)(backend, store)
|
||||
@ -37,7 +38,9 @@ object OutwatchApp extends BIOApp {
|
||||
el.setAttribute("id", "#app")
|
||||
document.body.appendChild(el)
|
||||
|
||||
app(el)
|
||||
val router = Router.router
|
||||
|
||||
app(el, router)
|
||||
.flatMap(_.run)
|
||||
.onErrorHandle(ex => UIO(ex.printStackTrace()))
|
||||
.as(ExitCode.Success)
|
||||
|
Loading…
Reference in New Issue
Block a user