Browse Source
Updated dependencies
Updated dependencies
Updated version to 0.0.10 Updated ScalaTest to 3.2.2 Updated scala version to 2.13.4 Updated scala.js version to 1.1.0 Updated to outwatch version to commit 676f94a Added dependency to outwatch-utils Updated scala.js bundler to 0.20.0 Updated sbt-microsites to 1.1.2 Removed obsolete scalac arguments Updated Router class itself - Now generic over effect type instead of being hardcoded to cats.effect.IO - Uses colibri.Observable instead of monix.Observable - Added history events listener to update dom on back/forward button pressmaster
11 changed files with 105 additions and 84 deletions
-
3.gitignore
-
1.scalafmt.conf
-
46build.sbt
-
73outwatch-router/src/main/scala/outwatch/router/Router.scala
-
14outwatch-router/src/main/scala/outwatch/router/dsl/C.scala
-
5outwatch-router/src/main/scala/outwatch/router/package.scala
-
3outwatch-router/src/test/scala/outwatch/router/AppRouterTestSpec.scala
-
10project/Options.scala
-
4project/Version.scala
-
2project/build.properties
-
6project/plugins.sbt
@ -1,13 +1,13 @@ |
|||||
package outwatch.router |
package outwatch.router |
||||
package dsl |
package dsl |
||||
|
|
||||
import outwatch.dom.VDomModifier |
|
||||
import outwatch.dom.{dsl => O, _} |
|
||||
|
import outwatch._ |
||||
|
import outwatch.dsl._ |
||||
|
|
||||
object C { |
object C { |
||||
def a[P](linkHref: String)(attrs: VDomModifier*)(implicit store: RouterStore[P]): BasicVNode = |
|
||||
O.a( |
|
||||
O.href := linkHref, |
|
||||
O.onClick.preventDefault.mapTo(Replace(Path(linkHref))) --> store |
|
||||
)(attrs) |
|
||||
|
def link[P](linkHref: String)(attrs: VDomModifier*)(implicit store: RouterStore[P]): BasicVNode = |
||||
|
a(href := linkHref)( |
||||
|
onClick.preventDefault.useLazy(Replace(Path(linkHref))) --> store.sink, |
||||
|
attrs, |
||||
|
) |
||||
} |
} |
@ -1,9 +1,10 @@ |
|||||
package outwatch |
package outwatch |
||||
|
|
||||
import outwatch.dom.VDomModifier |
|
||||
|
import outwatch._ |
||||
|
import colibri.ProSubject |
||||
|
|
||||
package object router { |
package object router { |
||||
type RouterStore[P] = ProHandler[Action, (Action, RouterState[P])] |
|
||||
|
type RouterStore[P] = ProSubject[Action, (Action, RouterState[P])] |
||||
|
|
||||
type RouterResolve[P] = PartialFunction[P, VDomModifier] |
type RouterResolve[P] = PartialFunction[P, VDomModifier] |
||||
} |
} |
@ -1,4 +1,4 @@ |
|||||
object Version { |
object Version { |
||||
val version = "0.0.9" |
|
||||
val scalaVersion = "2.12.8" |
|
||||
|
val version = "0.0.10" |
||||
|
val scalaVersion = "2.13.4" |
||||
} |
} |
@ -1 +1 @@ |
|||||
sbt.version=1.3.0-RC2 |
|
||||
|
sbt.version=1.4.3 |
@ -1,6 +1,6 @@ |
|||||
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28") |
|
||||
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6") |
|
||||
|
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.1.0") |
||||
|
addSbtPlugin("ch.epfl.scala" % "sbt-scalajs-bundler" % "0.20.0") |
||||
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "1.2.8") |
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "1.2.8") |
||||
addSbtPlugin("com.47deg" % "sbt-microsites" % "0.8.0") |
|
||||
|
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.1.2") |
||||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3") |
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3") |
||||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") |
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") |
Write
Preview
Loading…
Cancel
Save
Reference in new issue