Category: Coding

  • Reactive React component using MobX (counter example)

    In the following (muted) video for beginners I show how simple it is to make a React component reactive using MobX. Component displays counter’s value and buttons for incrementing and decrementing it and when user clicks the buttons, value is updated on screen accordingly. The main takeaway from this example is this: when observable variables…

  • On using Immutable.js

    I’ve been using Immutable.js for quite some time in my non-trivial React/Redux projects and it has been paying off. Beside Redux’s requirement of never mutating its state, the library provides other relevant features that were a deciding factor for me to start using it. This article explains very well, what immutability is, why it is…

  • Self-closing tag: Atom plugin for deleting redundant closing tag

    Couple days ago I’ve published my first plugin for Atom code editor which I really enjoy using. This plugin is named “self-closing tag” and is useful for situations when you expanded a HTML tag and than you make it self-closed ((By typing “/” before “>” in opening tag.)). Now instead of manually deleting redundant closing…

  • Autocomplete in RxJS (code walk)

    Autocomplete functionality is probably the first use case you hear for using RxJS. Here is one possible implementation for it (code can be also found in JSBin): let input = document.querySelector(‘input’) let inputStream = Rx.Observable.fromEvent(input, ‘input’) let ul = document.querySelector(‘ul’) let responseStream = inputStream .debounceTime(500) .map(e => e.target.value) .filter(value => !value | value.length > 2)…

  • InfluxDB: a time-series database to go

    InfluxDB is exciting new technology I’m learning at the moment. It’s a specialized database for storing time series. In short time-series is defined by its name and metric name(s). It consists of sequence of {timestamp, metric values} ((Baron Schwartz’s Blog: Time-Series Requirements)) where each record is uniquely defined by timestamp. The most obvious use case…