Handle keyboard input in Elm

Often we need to perform certain actions as a feedback to the input from the keyboard. For example, when we need to navigate within a list up and down or perform an action when the meta key (alt or shift) is pressed. Binding messages to keys The most natural and convenient way to specify which action must be performed when a key is pressed is to use a dictionary. We going to use a list of tuples of key codes plus messages. In the function below the first argument is the default (or fallback) action and the second argument is the mapping of keys to messages: ...

November 24, 2017 · 4 min

Implementation of function composition using spread operator and fat-arrow syntax

In this note, I would like to present my implementation of the function that performs function composition. We’re going to use spread operator and fat-arrow functions. First of all, it is not about writing shorter code or hacking around so that nobody understands it afterwards. If you are not familiar with this new syntax, you might find these two articles useful: fat-arrow functions and spread syntax. I’ll start with the initial, “old-school” implementation of comp function: ...

September 9, 2016 · 3 min

One more way to implement a carousel

There are lots of implementations of it: jQuery based, vanilla-js based, heavy and lightweight. Some even claim that their solution is the only one you might ever need. However, there will always be a situation when the existing solution simply doesn’t work. Here, at AutoScout24 we just had such situation and we decided to implement our own Carousel. We called it showcar-carousel. Please, do not hesitate to check the code out on GitHub repo for showcar-carousel. ...

August 30, 2016 · 3 min