Owlet


License

License

MIT
GroupId

GroupId

us.oyanglul
ArtifactId

ArtifactId

owlet_sjs1_2.12
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

Owlet
Owlet
Project URL

Project URL

https://oyanglul.us/owlet
Project Organization

Project Organization

us.oyanglul
Source Code Management

Source Code Management

https://github.com/jcouyang/owlet

Download owlet_sjs1_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/us.oyanglul/owlet_sjs1_2.12/ -->
<dependency>
    <groupId>us.oyanglul</groupId>
    <artifactId>owlet_sjs1_2.12</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/us.oyanglul/owlet_sjs1_2.12/
implementation 'us.oyanglul:owlet_sjs1_2.12:0.4.0'
// https://jarcasting.com/artifacts/us.oyanglul/owlet_sjs1_2.12/
implementation ("us.oyanglul:owlet_sjs1_2.12:0.4.0")
'us.oyanglul:owlet_sjs1_2.12:jar:0.4.0'
<dependency org="us.oyanglul" name="owlet_sjs1_2.12" rev="0.4.0">
  <artifact name="owlet_sjs1_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='us.oyanglul', module='owlet_sjs1_2.12', version='0.4.0')
)
libraryDependencies += "us.oyanglul" % "owlet_sjs1_2.12" % "0.4.0"
[us.oyanglul/owlet_sjs1_2.12 "0.4.0"]

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.11
org.scala-js : scalajs-library_2.12 jar 1.0.0
org.typelevel : cats-core_sjs1_2.12 jar 2.2.0-M1
com.github.julien-truffaut : monocle-core_sjs1_2.12 jar 2.0.4
com.github.julien-truffaut : monocle-macro_sjs1_2.12 jar 2.0.4
org.scala-js : scalajs-dom_sjs1_2.12 jar 1.0.0
io.monix : monix-reactive_sjs1_2.12 jar 3.2.1

test (5)

Group / Artifact Type Version
org.scala-js : scalajs-test-bridge_2.12 jar 1.0.0
org.scalatest : scalatest_sjs1_2.12 jar 3.3.0-SNAP2
org.typelevel : cats-laws_sjs1_2.12 jar 2.2.0-M1
org.typelevel : cats-testkit_sjs1_2.12 jar 2.2.0-M1
org.typelevel : cats-testkit-scalatest_sjs1_2.12 jar 1.0.1

Project Modules

There are no modules declared in this project.

Owlet

Owlet is a Typed Spreadsheet UI library for ScalaJS. It is built on top of Monix and Typelevel Cats to combine predefined input fields to a reactive user interface, just like what you would done in spreadsheet. Owlet is inspired by the PureScript library Flare.

Do one thing and do it well micro birds library series

Get Started

1. add dependency in your build.sbt

Stable

Latest version

libraryDependencies += "us.oyanglul" %%% "owlet" % "<maven version>"

RC

resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.jcouyang" % "owlet" % "<jitpact version>"

2. Now programming UI is just like using spreadsheet

import us.oyanglul.owlet._
import DOM._
val a1 = number("a1", 1)
val a2 = number("a2", 2)
val a3 = number("a3", 3)
val sum = fx[List, Double, Double](_.sum, List(a1, a2, a3))
render(a1 &> a2 &> a3 &> sum, "#app")

or Cats Friendly Badge

val a1 = number("a1", 1)
val a2 = number("a2", 2)
val a3 = number("a3", 3)
val sum = a1 |+| a2 |+| a3
renderOutput(sum, "#app")

eh... Ready for 3D spreadsheet programming?

You know spreadsheet is 2D, when we have monad, it became 3D

!!!Monad Warning!!!

val numOfItem = int("noi", 3)
val items = numOfItem
  .flatMap(
    no => (0 to no).toList.parTraverse(i => string("inner", i.toString))
  )
  • imagine that numOfItem lives in dimension (x=1, y=1, z=0)
  • then items live in dimension (x=1,y=1,z=1)

you can render either numOfItem or items seperatly, for they live in diffenrent z axis (which means render items you won't able to see numOfItem even it's flatMap from there

but you can some how connect the dots with magic &>

renderOutput(numOfItem &> items, "#output")

Anyway, just keep in mind that monad ops map ap flatMap... will lift your z axis parMap parAp parXXX instead, will keep them in the same z axis

More...

Versions

Version
0.4.0