diff --git a/src/main/scala/outwatch/router/Router.scala b/src/main/scala/outwatch/router/Router.scala index 9364b6a..19e612e 100644 --- a/src/main/scala/outwatch/router/Router.scala +++ b/src/main/scala/outwatch/router/Router.scala @@ -1,15 +1,15 @@ package outwatch.router -import org.scalajs.dom.window -import colibri.Observable -import outwatch.util.Store -import outwatch.util.Reducer import cats.effect.Sync +import colibri.Observable +import org.scalajs.dom.window import outwatch._ import outwatch.dsl._ -import outwatch.router.dsl.Path import outwatch.router.dsl.HashPath +import outwatch.router.dsl.Path import outwatch.router.dsl.Root +import outwatch.util.Reducer +import outwatch.util.Store sealed trait Action final case class Replace(path: Path) extends Action diff --git a/src/main/scala/outwatch/router/dsl/Path.scala b/src/main/scala/outwatch/router/dsl/Path.scala index 6106d1a..18c140a 100644 --- a/src/main/scala/outwatch/router/dsl/Path.scala +++ b/src/main/scala/outwatch/router/dsl/Path.scala @@ -2,11 +2,13 @@ package outwatch.router.dsl -import cats.implicits._ -import java.nio.{ByteBuffer, CharBuffer} +import java.nio.ByteBuffer +import java.nio.CharBuffer import java.nio.charset.Charset import java.nio.charset.StandardCharsets.UTF_8 +import cats.implicits._ + /** Base class for path extractors. */ trait Path { def /(child: String): Path = new /(this, child) diff --git a/src/main/scala/outwatch/router/package.scala b/src/main/scala/outwatch/router/package.scala index 652ff66..1b4692f 100644 --- a/src/main/scala/outwatch/router/package.scala +++ b/src/main/scala/outwatch/router/package.scala @@ -1,7 +1,7 @@ package outwatch -import outwatch._ import colibri.ProSubject +import outwatch._ package object router { type RouterStore[P] = ProSubject[Action, (Action, RouterState[P])] diff --git a/src/main/scala/outwatch/util/MonixWebSocket.scala b/src/main/scala/outwatch/util/MonixWebSocket.scala index 75a1ed2..993586f 100644 --- a/src/main/scala/outwatch/util/MonixWebSocket.scala +++ b/src/main/scala/outwatch/util/MonixWebSocket.scala @@ -1,16 +1,17 @@ package outwatch.util -import outwatch.helpers._ -// import colibri._ -import org.scalajs.dom.{Event, MessageEvent} +import scala.concurrent.Future + +import cats.Show import cats.effect.Sync +import monix.execution.Ack +import monix.execution.Cancelable import monix.reactive.Observable import monix.reactive.Observer -import monix.execution.Cancelable import monix.reactive.OverflowStrategy -import scala.concurrent.Future -import monix.execution.Ack -import cats.Show +import org.scalajs.dom.Event +import org.scalajs.dom.MessageEvent +import outwatch.helpers._ object MonixWS { // implicit def toObserver[F[_]: Sync, S: Show]( diff --git a/src/main/scala/outwatch/util/WebSocket2.scala b/src/main/scala/outwatch/util/WebSocket2.scala index 04afe52..dc26ef4 100644 --- a/src/main/scala/outwatch/util/WebSocket2.scala +++ b/src/main/scala/outwatch/util/WebSocket2.scala @@ -1,9 +1,10 @@ package outwatch.util -import outwatch.helpers._ -import colibri._ -import org.scalajs.dom.{Event, MessageEvent} import cats.effect.Sync +import colibri._ +import org.scalajs.dom.Event +import org.scalajs.dom.MessageEvent +import outwatch.helpers._ object WebSocketF { implicit def toObserver[F[_]: Sync]( diff --git a/src/main/scala/outwatchapp/OutwatchApp.scala b/src/main/scala/outwatchapp/OutwatchApp.scala index 3009751..36954cf 100644 --- a/src/main/scala/outwatchapp/OutwatchApp.scala +++ b/src/main/scala/outwatchapp/OutwatchApp.scala @@ -1,24 +1,24 @@ package outwatchapp -import outwatch._ -import outwatch.dsl._ +import scala.concurrent.duration._ import cats.effect.ExitCode -import monix.bio._ -import colibri.ext.monix._ -import monix.reactive.Observable -import scala.concurrent.duration._ import cats.implicits._ +import colibri.ext.monix._ +import monix.bio._ +import monix.eval.Coeval +import monix.reactive.Observable +import monix.{eval => me} +import nova.monadic_sfx.ui.components.todo.Todo +import nova.monadic_sfx.ui.components.todo.TodoListStore +import outwatch._ +import outwatch.dsl._ +import outwatch.reactive.handlers.monix._ import outwatch.router.AppRouter import outwatch.router.dsl._ -import sttp.client.impl.monix.FetchMonixBackend -import outwatch.reactive.handlers.monix._ -import sttp.client._ -import monix.{eval => me} -import nova.monadic_sfx.ui.components.todo.TodoListStore import outwatchapp.implicits._ -import monix.eval.Coeval -import nova.monadic_sfx.ui.components.todo.Todo +import sttp.client._ +import sttp.client.impl.monix.FetchMonixBackend object OutwatchApp extends BIOApp { val counter2 = Observable.interval(1.second) diff --git a/src/main/scala/outwatchapp/implicits/package.scala b/src/main/scala/outwatchapp/implicits/package.scala index 192f69b..b321243 100644 --- a/src/main/scala/outwatchapp/implicits/package.scala +++ b/src/main/scala/outwatchapp/implicits/package.scala @@ -1,17 +1,11 @@ package outwatchapp -import colibri.Sink -import nova.monadic_sfx.util.reactive.store.MonixProSubject -import cats.effect.Sync -import colibri.CreateProSubject -import colibri.Source import colibri.LiftSink -import monix.reactive.Observer import colibri.LiftSource -import monix.reactive.Observable import colibri.ext.monix._ import monix.execution.Scheduler -import monix.execution.Ack +import monix.reactive.Observable +import monix.reactive.Observer package object implicits { // implicit def sinkForMyMonixProSub[A, M] = diff --git a/src/main/scala/outwatchapp/util/reactive/store/Middlewares.scala b/src/main/scala/outwatchapp/util/reactive/store/Middlewares.scala index 98165fd..f0a31c4 100644 --- a/src/main/scala/outwatchapp/util/reactive/store/Middlewares.scala +++ b/src/main/scala/outwatchapp/util/reactive/store/Middlewares.scala @@ -2,12 +2,8 @@ package nova.monadic_sfx.util.reactive.store import java.time.LocalDateTime -import io.circe.Encoder import io.circe.Printer import io.circe.generic.JsonCodec -import io.circe.syntax._ -import monix.bio.Task -import monix.reactive.Observable // object Middleware { // def apply[A,M,T](ob: Observable[(A,M)], cb: (A,M) => T): Observable[(A,M)] = ob // }