Scala.js and unidirectional data flow 2

Tags: , , , , ,

Scala.js and unidirectional data flow 2

Scala.js and unidirectional data flow 2

Last time we talked about using Monix as a tool of creating unidirectional data flow in Scala.js applications. The tiny Dispatcher class was made for that purpose. We considered the Counter example, which demonstrated all the power of this approach. Today I intend to widen our horizons and to consider another example: more complex one: which will demonstrate not only usage of the Dispatcher but also usage of Sortable.js with React. But before that I want to add some new methods to the Dispatcher class. Here is the full code of the Dispatcher class: import monix.execution.Ack import monix.execution.Ack.Continue import monix.reactive.{Observable,

Continue Reading

Scala.js and unidirectional data flow

Scala.js and unidirectional data flow

During the last two years the one of the most popular subjects for discussion in the JavaScript society  is so-called “unidirectional data flow”. Those happy years, when we used JavaScript for organizing of some effect on the page or for loading some widget by Ajax, gone to the past. Today JavaScript is used for building client-side web applications. There are several frameworks for doing such things. I used React in my last projects. It’s a great library. It allows doing everything you want. Except unidirectional data flow. You have to use Flux or Redux for that purpose. But what about

Continue Reading

Let’s create a Slider

Let’s create a Slider

I have started to write code on Scala.js half a year ago and I can’t stop doing it. I should say that I love JavaScript and I wrote hundreds of thousands lines of code. But there is one thing that always frustrates me in JavaScript: It hasn’t many useful things that other languages have. You should use some or other framework (I used yui and jquery in the past). I used CoffeeScript a year ago. Today it’s time for Babel. Nobody wants writing plain JavaScript anymore! I choose Scala. See the Demo to this post. A Slider is a program

Continue Reading