cornerman / colibri Goto Github PK
View Code? Open in Web Editor NEWA simple functional reactive library for ScalaJS
License: MIT License
A simple functional reactive library for ScalaJS
License: MIT License
@busti fyi
ZIO 2.0 was recently released. ZIO integration needs to be updated to latest streams.
Subscriptions, Cancellations and onNext
/onError
should be referentially transparent. We should return an effect type.
We should have a project colibri-types
(just type classes) and a project colibri
(depending on types and providing a simple js implementation).
The following code fails using the macro.
val myRx: Rx[(Int, Int, Int)] = ???
Rx {
val (x, y, z) = myRx() // No implicit LiveOwner is available here! Wrap inside `Rx { <code> }`, or provide an implicit `LiveOwner`.
}
The following code fails to compile:
def foo: VNode = Owned {
case class Foo(a: Int, b: String)
div
}
With the following error message:
[error] /bar/foo.scala:390:22: private[this] not allowed for case class parameters
[error] case class Foo(a: Int, b: String)
[error] ^
[error] /bar/foo.scala:390:30: private[this] not allowed for case class parameters
[error] case class Foo(a: Int, b: String)
[error] ^
[error] /bar/foo.scala:390:18: value a is not a member of Nothing
[error] case class Foo(a: Int, b: String)
[error]
Hey! I was working on an Outwatch
project, and wanted to pull in some new Http4s dependencies, and I got stuck on the classic problem of "you need Cats Effect 3 for this" problem - would it be helpful if I took a crack at upgrading colibri to Cats Effects 3, or is there anything blocking that at the moment?
I'm using this right now:
extension [T](obs: Observable[T]) {
def first(using ExecutionContext) = observableFirstFuture(obs)
}
def observableFirstFuture[T](obs: Observable[T])(using ExecutionContext): Future[T] = {
val promise = Promise[T]
val future = promise.future
val cancelable = obs.take(1).attempt.unsafeForeach(value => promise.complete(value.toTry))
future.onComplete(_ => cancelable.unsafeCancel())
future
}
scala.rx currently only available for 2.11 and 2.12. We need to wait for a new release!
I'd like to sync Observable
into RxWriter
/Observers
:
// with implicit Owner in scope:
val number = Var(0)
Observable.intervalMillis(1000).subscribe(number)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.