Tag: Javascript

  • Using Ramda’s evolve in Redux reducers to create new state

    Ramda is a JavaScript utility library similar to lodash or underscore ((I haven’t used underscore in ages though)) with an extra touch – it’s designed to be better suited to functional style of programming. For example it provides automatic currying ((Remodeling function in a way that instead of accepting multiple arguments at once it accepts…

  • redux-observable is epic, goodbye redux-thunk and axios

    Redux-observable is alternative way of performing async operations in JavaScript applications that use redux, apart from redux-thunk. And certainly more awesome. It uses RxJS underneath which I already wrote about briefly. Apart from bringing the power of functional reactive programming into my application I also see it as a way to better structure my application…

  • Functional programming

    2016 was the year my understanding and appreciation for functional programming grew big time. Functional programming (FP for short) is a programming model old as programming but its popularity gained traction only a couple of years ago. According to Wikipedia, it’s “a style of building the structure and elements of computer programs—that treats computation as…

  • 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…

  • 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)…