Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 12 17:18

    mergify[bot] on master

    Update scalafmt-core to 3.5.9 (… (compare)

  • Aug 12 17:18
    mergify[bot] closed #638
  • Aug 12 17:12
    mergify[bot] labeled #638
  • Aug 12 17:12
    scala-steward opened #638
  • Aug 08 15:42
    mergify[bot] labeled #637
  • Aug 08 15:42
    scala-steward opened #637
  • Jul 31 16:43

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ ou… (compare)

  • Jul 31 16:43
    mergify[bot] closed #636
  • Jul 31 16:43

    mergify[bot] on master

    Update scalatest to 3.2.13 (#63… (compare)

  • Jul 31 16:40
    mergify[bot] closed #64
  • Jul 31 16:40

    mergify[bot] on master

    Update scalatest to 3.2.13 (#64) (compare)

  • Jul 31 16:37
    mergify[bot] labeled #64
  • Jul 31 16:37
    scala-steward opened #64
  • Jul 31 16:37
    mergify[bot] labeled #636
  • Jul 31 16:36
    scala-steward opened #636
  • Jul 27 16:34

    mergify[bot] on master

    Update sbt-mdoc to 2.3.3 (#635) (compare)

  • Jul 27 16:34
    mergify[bot] closed #635
  • Jul 27 16:28
    mergify[bot] labeled #635
  • Jul 27 16:27
    scala-steward opened #635
  • Jul 24 15:20

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ ou… (compare)

Aleksandr Bogdanov
@laniakea-landscape_gitlab

I saw you're doing unsafeRunSync on the handler as well.

That stuff is from manual

Rohan Sircar
@rohan-sircar
The manual should be edited as well then
Aleksandr Bogdanov
@laniakea-landscape_gitlab
That`s true
Aleksandr Bogdanov
@laniakea-landscape_gitlab
Thank you for code with best practices. But so many questions)
Aleksandr Bogdanov
@laniakea-landscape_gitlab
At least can you show your imports.
elyphas
@elyphas
@laniakea-landscape_gitlab , i think with:
import cats._
Is enought
Aleksandr Bogdanov
@laniakea-landscape_gitlab
What about import monix.{eval => me} ? By the way I solved this puzzle several minutes ago)
elyphas
@elyphas
Try import colibri.ext.monix._
:) great
How?
Aleksandr Bogdanov
@laniakea-landscape_gitlab
awww... it seems still not finished :)
elyphas
@elyphas
Ups
Aleksandr Bogdanov
@laniakea-landscape_gitlab
still cannot resolve symbol createF in val handlerTask = Handler.createF[monix.bio.Task, String]("empty")
elyphas
@elyphas
Maybe:
monix._
import monix._
Or
outwatch.reactive.handler._
import outwatch.reactive.handler._
Aleksandr Bogdanov
@laniakea-landscape_gitlab
my imports right now:
import cats.effect.ExitCode

import monix.execution.Scheduler
import monix.{eval => me}
import monix.bio._

import outwatch._
import outwatch.dsl._
import outwatch.reactive.handler._

import sttp.client3._
import sttp.client3.impl.monix.FetchMonixBackend
import sttp.capabilities.monix.MonixStreams

import java.util.concurrent.TimeUnit
import scala.concurrent.duration.Duration
I can use val handlerTask = Handler.createF[monix.bio.Task, String] without seed
Aleksandr Bogdanov
@laniakea-landscape_gitlab
But then I still need implicit for Sync[IO] parameter
And somehow not found mapEval here:
handler
    .doOnNext(str => me.Task(println(str)))
    .mapEval(query => request(query))
That is why I am interested why @rohan-sircar s code works)
elyphas
@elyphas
Maybe:
import cats.implicits._
Aleksandr Bogdanov
@laniakea-landscape_gitlab
I had imports from cats and cats.effets implicits
elyphas
@elyphas
import monix.eval.Task
Aleksandr Bogdanov
@laniakea-landscape_gitlab
nope
Rohan Sircar
@rohan-sircar
You need to import import outwatch.reactive.handlers.monix._
Here are all of my imports just in case https://pastebin.com/3zm6eZTg
Rohan Sircar
@rohan-sircar
Btw everyone my PR to update outwatch router to latest versions of scala/outwatch got merged - clovellytech/outwatch-router#9 . So there's a functioning router for outwatch now.
goes back to sleep
Aleksandr Bogdanov
@laniakea-landscape_gitlab

Here are all of my imports just in case https://pastebin.com/3zm6eZTg

No way =( It compiles after addition of this:

    def scheduler: Scheduler = Scheduler.global
    def options: IO.Options  = IO.defaultOptions.withSchedulerFeatures(scheduler)
    implicit lazy val catsEffect: ConcurrentEffect[Task] =
      new CatsConcurrentEffectForTask()(scheduler, options)

But nothing on the screen, unfortunately. Even no input field.

elyphas
@elyphas
@laniakea-landscape_gitlab; Are you sure your div id in your html correspond where outwatch is going to render?
Aleksandr Bogdanov
@laniakea-landscape_gitlab
@elyphas Sure. Checked it again.
Rohan Sircar
@rohan-sircar
@laniakea-landscape_gitlab you definitely don't need any of that. I'll upload my project tomorrow.
Rohan Sircar
@rohan-sircar
Rohan Sircar
@rohan-sircar
@laniakea-landscape_gitlab well? did it work?
Raphael Mäder
@randm-ch

Hello there. I'm trying to get into outwatch. It seems to me that the docs are a bit outdated, what's the most recent/best source?
In particular, at the moment I want to get a simple example to work:

import cats.effect._
import outwatch._
import outwatch.dsl._
import outwatch.reactive.handler._
import outwatch.util._
import scala.concurrent.ExecutionContext.Implicits.global

object Main extends IOApp {
  private val app = for {
    hdl <- Handler.createF[IO]("")
    qry <- IO.pure(hdl.map(query => Http.Request(s"https://someurl.org?query=$query")))
    res <- IO(Http.get(qry).map(_.body))
    xml <- IO.pure(div(
      input(onInput.value --> hdl),
      span(child <-- res)
    ))
    rnd <- OutWatch.renderInto[IO]("#app", xml)
  } yield rnd

  override def run(args: List[String]): IO[ExitCode] =
    app.as(ExitCode.Success)
}

but child is not available. Am I missing an import? Or did something change? Thanks!

johannes karoff
@cornerman
Hi @randm-ch , yeah the docs on the outwatch page are a bit outdated. Please refer to the github readme. The documentation there is up to date.
I will have to do something about the old webpage and remove the outdated content there.
For the question here: you can just leave out the child <-- and just put the observable into the element directly: span(res)
Raphael Mäder
@randm-ch
Perfect, thanks a bunch for the info & all your work :)
Aleksandr Bogdanov
@laniakea-landscape_gitlab

@laniakea-landscape_gitlab well? did it work?

@rohan-sircar Sorry for silence, I will look in several days. Was extremely busy last weeks.

Per Wiklander
@PerWiklander
Has anyone used Akka.js and Akka Streams and Actors for the state handling layer of an Outwatch application?
moritz bust
@busti
@PerWiklander I haven't used akka specifically, but what I am trying to do is very similar to akka. But that comes from a person who has little to no experience with akka.
That being said, I am very interested in that discussion in general.