Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Luka Jacobowitz
    @LukaJCB
    And then you can form a byte array of of the utf-8 string
    Andrew Gaydenko
    @gaydenko
    The issue clarify text/html was used. And, well, as for octet stream , it can not be encoded as UTF8 string. It must be passed as is.
    Luka Jacobowitz
    @LukaJCB
    So it should probably be an Option[Array[Byte]]?
    I'm not sure how to deal with that, maybe you'd want to create a PR?
    Andrew Gaydenko
    @gaydenko
    In fact I agree bytes isn't too common on the client side, and it would be sufficient to get a body as a string as is only. So, resuming, it would be great if response contains (probably also contains) body as text as is.
    That is HTTP client must not hide raw string body even it decides to decode JSON.
    Luka Jacobowitz
    @LukaJCB
    I'll also include the original XMLHttpRequest
    Andrew Gaydenko
    @gaydenko
    As the way to responseText? Yes, it would be handy.
    Luka Jacobowitz
    @LukaJCB
    The problem is that responseText isn't set 80% of the time
    Andrew Gaydenko
    @gaydenko
    Is it set at the moment an obsrervable notifies subscribers?
    Then it can be copied to Response field.
    Luka Jacobowitz
    @LukaJCB
    It is
    Luka Jacobowitz
    @LukaJCB
    i just pushed a couple of commits
    Andrew Gaydenko
    @gaydenko
    Aha, I see, if (response.responseType == "json") and + .xhr, great, thanks!
    Are you going to publish it?
    Aha, and a body as dynamic...
    Luka Jacobowitz
    @LukaJCB
    Yes will do (:
    Andrew Gaydenko
    @gaydenko

    @LukaJCB To better understand Observable used in OutWatch I'm reading RxJs scala documentation, and it is interesting reading :smile: As far as rxscala-js is facade, I can hope that documentation is, in fact, rxscala-js' documentation also. Is it true?
    Or - are you going to make OutWatch Monix-based? :smile: In fact, rxscala-js as OutWatch base move me to some doubt (as well as not-scala vdom implementation).

    Probably I must dig in Monix documentation already...

    Luka Jacobowitz
    @LukaJCB
    I'm not sure I completly understand your question, you're asking if RxScala documentation also applies to rxscala-js? (:
    I'd like to make it Monix based, or at least add as an option, if someone could figure out to add it in a backwards compatible way, I'd do it in a heartbeat!
    Andrew Gaydenko
    @gaydenko
    Sorry, typo ("RxJ scala " must be just "RxJs"). I'm asking if RxJs documentations also applies to rxscala-js.
    Luka Jacobowitz
    @LukaJCB
    it does!
    Rx is mostly the same across platforms
    which is one of the reasons I chose it
    Andrew Gaydenko
    @gaydenko
    @LukaJCB How to create Observable from window event (say, hashchange/popstate)? fromEvent wants Element rather Window.
    Andrew Gaydenko
    @gaydenko
    It seems this one does work:
      val hashes = Observable.create { observer: Observer[String] =>
        dom.window.onhashchange = { e =>
          val url = e.asInstanceOf[HashChangeEvent].newURL
          val idx = url.indexOf("#")
          val hash = if (idx >= 0) url.substring(idx + 1) else ""
          observer.next(hash)
        }
      }
    Luka Jacobowitz
    @LukaJCB
    Yup, that's the way, I'd go as well!