diff options
Diffstat (limited to 'book/src/main/scalatex')
3 files changed, 9 insertions, 3 deletions
diff --git a/book/src/main/scalatex/book/handson/WebPage.scalatex b/book/src/main/scalatex/book/handson/WebPage.scalatex index 58fceb1..1056460 100644 --- a/book/src/main/scalatex/book/handson/WebPage.scalatex +++ b/book/src/main/scalatex/book/handson/WebPage.scalatex @@ -159,7 +159,7 @@ @li @hl.scala("=>") v.s. @hl.javascript{function} to define the callback. @li - Scalatags' @hl.scala{pre} v.s. @hl.javascript{document.createElement} + Scalatags' @hl.scala{pre} v.s. @hl.javascript{document.createElement("pre")} @p Overall, they're pretty close, which is a common theme in Scala.js: using Javascript APIs in Scala.js is often as seamless and easy as using them in Javascript itself, and it often looks almost identical. diff --git a/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex b/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex index f368a71..171b2d3 100644 --- a/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex +++ b/book/src/main/scalatex/book/indepth/AdvancedTechniques.scalatex @@ -26,7 +26,7 @@ @li @b{Continuous}: Handling of first-class signals, like in @link("Elm", "http://elm-lang.org/learn/What-is-FRP.elm") - @sect{Why FPR} + @sect{Why FRP} @p The value proposition of FRP is that in a "traditional" program, when an event occurs, events and changes propagate throughout the program in an ad-hoc manner. An event-listener may trigger additional events, call some callbacks, or set some mutable variables that subsequent code will read and react to. diff --git a/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex b/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex index cecead8..0ad886d 100644 --- a/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex +++ b/book/src/main/scalatex/book/indepth/JavaAPIs.scalatex @@ -35,4 +35,10 @@ @hl.scala{sun.misc.Unsafe} @p - And other similar APIs will either need to be rewritten to not-use them (e.g. @lnk("AtomicIntegers", "https://github.com/scala-js/scala-js/blob/master/javalib/src/main/scala/java/util/concurrent/atomic/AtomicInteger.scala") can be written without threading/unsafe APIs because Javascript is single-threaded) or can't be ported at all (e.g. @code{java.io.File})
\ No newline at end of file + And other similar APIs will either need to be rewritten to not-use them. For example, @hl.scala{AtomicXXXs} can be written without threading/unsafe APIs because Javascript is single-threaded, making the implementation for e.g. an @hl.scala{AtomicBoolean} pretty trivial: + + @hl.ref("output/scala-js/javalib/src/main/scala/java/util/concurrent/atomic/AtomicBoolean.scala") + + @p + Others can't be ported at all (e.g. @code{java.io.File}) simply because the API capabilities they provide (blocking reads & writes to files) do not exist in the Javascript runtime. + |