Learn Ramda.js

Learn how you can use ramda.js to bring functional programming concepts into your JavaScript code. Ramda offers composability and immutability right out of the box, so you can leave your imperative code behind and build cleaner, more maintainable code.

Watch User Created Playlist (24)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

Refactor to Point Free Functions with Ramda using compose and converge

P

Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

P

Convert a QueryString to an Object using Function Composition in Ramda

P

Select a Subset of Properties from a Collection of Objects in Ramda

P

Handle Branching Logic with Ramda's Conditional Functions

P

Declaratively Map Predicates to Object Properties Using Ramda where

P

Change Object Properties with Ramda Lenses

P

Add and Remove Items in Arrays using Filter, Reject and Partition in Ramda

P

Build a Functional Pipeline with Ramda.js

P

Pick and Omit Properties from Objects Using Ramda

P

Curry and Uncurry Functions with Ramda

P

Declaratively Map Data Transformations to Object Properties Using Ramda evolve

P

Count Words in a String with Ramda's countBy and invert

P

Handle Errors in Ramda Pipelines with tryCatch

P

Create an Array From a Seed Value with Ramda's unfold

P

Convert a Promise.all Result to an Object with Ramda's zip and zipObj

P

Filter an Array Based on Multiple Predicates with Ramda's allPass Function

P

Create a Query String from an Object using Ramda's toPairs function

P

Convert Object Methods into Composable Functions with Ramda

P

Sort an Array of Objects by Multiple Fields with Ramda's sortWith

P

Refactor a Promise Chain to Function Composition using Ramda

P

Refactor to a Point Free Function with Ramda's useWith Function

P

Get a List of Unique Values From Nested Arrays with Ramda

P

Debug Function Compositions with Ramda's Tap Function

P
js tutorial about Refactor to Point Free Functions with Ramda using compose and converge

Refactor to Point Free Functions with Ramda using compose and converge

3:33 js PRO

In this lesson we'll take some existing code and refactor it using some functions from the Ramda library, most notably, compose and converge. When we're done, we'll have taken a function with a couple of local variables and parameter references and converted it into more streamlined "point-free" or "tacit" functions.

js tutorial about Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

Eliminate Function Arguments (Point-Free Style) with Ramda's Converge

3:47 js PRO

When doing comparisons inside of functions, you end of relying heavily on the argument passed into the function. Ramda's converge allows you to do comparisons in a Point-Free style allowing you more flexibility with composing and constructing functions. This lesson walks through refactoring a function to Point-Free style using Ramda's Converge.

js tutorial about Convert a QueryString to an Object using Function Composition in Ramda

Convert a QueryString to an Object using Function Composition in Ramda

2:13 js PRO

In this lesson we'll use a handful of Ramda's utility functions to take a queryString full of name/value pairs and covert it into a JavaScript object so we can access those properties in a more useful way. Along the way, we'll build up a composition and look at the tail, split, map and fromPairs functions, along with the crucial compose function.

js tutorial about Select a Subset of Properties from a Collection of Objects in Ramda

Select a Subset of Properties from a Collection of Objects in Ramda

2:59 js PRO

In this lesson we'll take an array of objects and map it to a new array where each object is a subset of the original. We'll look at multiple ways to accomplish this, refactoring our code into a simple and easy to read function using Ramda's map, pick and project functions.

js tutorial about Handle Branching  Logic with Ramda's Conditional Functions

Handle Branching Logic with Ramda's Conditional Functions

5:30 js PRO

When you want to build your logic with small, composable functions you need a functional way to handle conditional logic. You could wrap ternary expressions and if/else statements in functions, handling all of the concerns around data mutation yourself, or you could leverage the conditional functions supplied by Ramda. In this lesson, we'll cover several of Ramda's conditional functions: ifElse, unless, when and cond

js tutorial about Declaratively Map Predicates to Object Properties Using Ramda where

Declaratively Map Predicates to Object Properties Using Ramda where

2:34 js PRO

Sometimes you need to filter an array of objects or perform other conditional logic based on a combination of factors. Ramda's where function gives you a concise way to declaratively map individual predicates to object properties, that when combined, cover the various facets of your conditions. In this lesson, we'll look at how this powerful function can be used for scenarios requiring a complex predicate function.

js tutorial about Change Object Properties with Ramda Lenses

Change Object Properties with Ramda Lenses

4:46 js PRO

In this lesson we'll learn the basics of using lenses in Ramda and see how they enable you to focus changes on specific properties of an object while keeping your data immutable.

js tutorial about Add and Remove Items in Arrays using Filter, Reject and Partition in Ramda

Add and Remove Items in Arrays using Filter, Reject and Partition in Ramda

2:09 js PRO

We'll learn how to get a subset of an array by specifying items to include with filter, or items to exclude using reject. We'll also look at how to get the results from both filter and reject, neatly separated with partition.

js tutorial about Build a Functional Pipeline with Ramda.js

Build a Functional Pipeline with Ramda.js

5:37 js PRO

We'll learn how to take advantage of Ramda's automatic function currying and data-last argument order to combine a series of pure functions into a left-to-right composition, or pipeline, with Ramda's pipe function.

js tutorial about Pick and Omit Properties from Objects Using Ramda

Pick and Omit Properties from Objects Using Ramda

5:39 js PRO

Sometimes you just need a subset of an object. In this lesson, we'll cover how you can accomplish this using Ramda's pick and omit functions, as well as the pickAll and pickBy variants of pick.

js tutorial about Curry and Uncurry Functions with Ramda

Curry and Uncurry Functions with Ramda

3:39 js PRO

Most of the functions offered by the ramda library are curried by default. Functions you've created or that you've pulled in from another library may not be curried. Ramda's curry and curryN functions allow you to take a non-curried function and use it as a curried functions. In the case where you have a manually curried function and you want to just call it like a normal function, you can use uncurryN to get back a function that accepts all of the arguments at once.

js tutorial about Declaratively Map Data Transformations to Object Properties Using Ramda evolve

Declaratively Map Data Transformations to Object Properties Using Ramda evolve

2:44 js PRO

We don't always control the data we need in our applications, and that means we often find ourselves massaging and transforming our data. In this lesson, we'll learn how to transform objects in a declarative way using ramda's evolve function.

js tutorial about Count Words in a String with Ramda's countBy and invert

Count Words in a String with Ramda's countBy and invert

4:10 js PRO

You can really unlock the power of ramda (and functional programming in general) when you combine functions. Counting words in a string may seem like a relatively difficult task, but ramda makes it easy by providing a countBy function. This lesson walks through using the countBy to count words in a string.

js tutorial about Handle Errors in Ramda Pipelines with tryCatch

Handle Errors in Ramda Pipelines with tryCatch

2:32 js PRO

Handling your logic with composable functions makes your code declarative, leading to code that's easy to read and easy to test. Breaking that up to wrap some risky function in a try/catch block introduces imperative code and makes it harder to maintain that declarative approach. With Ramda's tryCatch function, you can handle errors right in the middle of a composition and leave your code clean and functional. We'll also see how you can use propOr to avoid common "cannot find X of undefined" errors.

js tutorial about Create an Array From a Seed Value with Ramda's unfold

Create an Array From a Seed Value with Ramda's unfold

3:05 js PRO

In this lesson we'll look at how you can use Ramda's unfold function to generate a list of values based on an initial seed.

js tutorial about Convert a Promise.all Result to an Object with Ramda's zip and zipObj

Convert a Promise.all Result to an Object with Ramda's zip and zipObj

3:11 js PRO

In this lesson, we'll use Promise.all to get an array that contains the resolved values from multiple promises. Then we'll see how we can use Ramda to convert that array of values into a single object using zip with fromPairs. Then we'll refactor to use zipObj.

js tutorial about Filter an Array Based on Multiple Predicates with Ramda's allPass Function

Filter an Array Based on Multiple Predicates with Ramda's allPass Function

2:24 js PRO

In this lesson, we'll filter a list of objects based on multiple conditions and we'll use Ramda's allPass function to create a joint predicate from multiple, individual predicate functions.

js tutorial about Create a Query String from an Object using Ramda's toPairs function

Create a Query String from an Object using Ramda's toPairs function

2:24 js PRO

In this lesson, we'll use Ramda's toPairs function, along with map, join, concat and compose to create a reusable function that will convert an object to a querystring.

js tutorial about Convert Object Methods into Composable Functions with Ramda

Convert Object Methods into Composable Functions with Ramda

4:44 js PRO

In this lesson, we'll look at how we can use Ramda's invoker and constructN functions to take methods of an object and turn them into reusable utility functions that are curried and accept their object as the last argument. We'll convert a dot-chained string of jQuery methods and create a composed function that can be applied to multiple elements.

js tutorial about Sort an Array of Objects by Multiple Fields with Ramda's sortWith

Sort an Array of Objects by Multiple Fields with Ramda's sortWith

1:58 js PRO

Sorting an array of objects by multiple fields can be tricky. Even worse, the code can be tough to follow and making changes in the future is complicated by conditional logic in the sorting function. In this lesson we'll see how to simplify this using Ramda's sortWith along with ascending and descending. We'll sort an array of objects by multiple fields and the code will be readable and dead simple to change.

js tutorial about Refactor a Promise Chain to Function Composition using Ramda

Refactor a Promise Chain to Function Composition using Ramda

8:37 js PRO

Promise chains can be a powerful way to handle a series of transformations to the results of an async call. In some cases, additional promises are required along the way. In cases where there are no new promises, function composition can reduce the number of dot chained thens you need. In this lesson, we'll look at how to take a promise chain, and reduce it down with function composition.

js tutorial about Refactor to a Point Free Function with Ramda's useWith Function

Refactor to a Point Free Function with Ramda's useWith Function

3:41 js PRO

Naming things is hard and arguments in generic utility functions are no exception. Making functions "tacit" or "point free" removes the need for the extra parameter names and can make your code cleaner and more succinct. In this lesson, we'll create a normal, "pointed" function and then use ramda's useWith function to refactor our way to point-free bliss.

js tutorial about Get a List of Unique Values From Nested Arrays with Ramda

Get a List of Unique Values From Nested Arrays with Ramda

5:55 js PRO

In this lesson, we'll grab arrays of values from other arrays, resulting in a nested array. From there, we'll look at multiple ways to flatten the array structure using composition with map and unnest and then refactoring to use chain, AKA flatMap. Finally, we'll add Ramda's uniq function to remove duplicate values.

js tutorial about Debug Function Compositions with Ramda's Tap Function

Debug Function Compositions with Ramda's Tap Function

2:48 js PRO

Functional composition is a great way to write declarative code that reads well. But sometimes, you need to get insight into what's happening at different steps in your composition. This is where tap comes in. With tap, we can run code that generates side-effects, like logging to the console, and our data will continue to be passed along, untouched.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?