aboutsummaryrefslogtreecommitdiff
path: root/examples/todomvc/src/main/kotlin/com/example/Main.kt
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-03 23:21:46 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-03 23:21:46 +0100
commit9665fe692681bc958e55d00cc0d0b238b7aee694 (patch)
treedd222dec725f64b8065a09311d9b034e9b9751b3 /examples/todomvc/src/main/kotlin/com/example/Main.kt
parent180528f620e53e4a828d6f4d427ce83817572f44 (diff)
downloadkvision-9665fe692681bc958e55d00cc0d0b238b7aee694.tar.gz
kvision-9665fe692681bc958e55d00cc0d0b238b7aee694.tar.bz2
kvision-9665fe692681bc958e55d00cc0d0b238b7aee694.zip
Refactoring for kdoc API documentation with dokka
Diffstat (limited to 'examples/todomvc/src/main/kotlin/com/example/Main.kt')
-rw-r--r--examples/todomvc/src/main/kotlin/com/example/Main.kt40
1 files changed, 0 insertions, 40 deletions
diff --git a/examples/todomvc/src/main/kotlin/com/example/Main.kt b/examples/todomvc/src/main/kotlin/com/example/Main.kt
deleted file mode 100644
index d8894a4c..00000000
--- a/examples/todomvc/src/main/kotlin/com/example/Main.kt
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.example
-
-import pl.treksoft.kvision.ApplicationBase
-import pl.treksoft.kvision.core.KVManager
-import pl.treksoft.kvision.module
-import kotlin.browser.document
-
-fun main(args: Array<String>) {
- var application: ApplicationBase? = null
-
- val state: dynamic = module.hot?.let { hot ->
- hot.accept()
-
- hot.dispose { data ->
- data.appState = application?.dispose()
- KVManager.shutdown()
- application = null
- }
-
- hot.data
- }
-
- if (document.body != null) {
- KVManager.start()
- application = start(state)
- } else {
- KVManager.init()
- application = null
- document.addEventListener("DOMContentLoaded", { application = start(state) })
- }
-}
-
-fun start(state: dynamic): ApplicationBase? {
- if (document.getElementById("todomvc") == null) return null
- val application = Todomvc()
- @Suppress("UnsafeCastFromDynamic")
- application.start(state?.appState ?: emptyMap())
- return application
-}
-