Ramda.js

Functional Programming with Ramda.js

Watch User Created Playlist (17)

This playlist is user created.

pro-course-rss-logo

PRO RSS Feed

Create a Reusable Mapping Function with Ramda's Map

P

Get Deeply Nested Properties Safely with Ramda's path and pathOr Functions

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

Refactor a Promise Chain to Function Composition using Ramda

P

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

P

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

P

Get a List of Unique Values From Nested Arrays with Ramda

P

Debug Function Compositions with Ramda's Tap Function

P

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

P

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

P

Refactor to Point Free Functions with Ramda using compose and converge

P

Handle Errors in Ramda Pipelines with tryCatch

P

Update Component State in React With Ramda Lenses

P

Update State in React with Ramda's Evolve

P
ramda tutorial about Create a Reusable Mapping Function with Ramda's Map

Create a Reusable Mapping Function with Ramda's Map

3:52 ramda PRO

Using the map method of an array is a great way to create new data from an existing array in an immutable way and without writing any loops. The problem is that you need to call it on an existing array instance. In the lesson we'll see how to build our own reusable map utility function using manual currying and then we'll replace it with Ramda's map.

ramda tutorial about Get Deeply Nested Properties Safely with Ramda's path and pathOr Functions

Get Deeply Nested Properties Safely with Ramda's path and pathOr Functions

4:03 ramda PRO

In this lesson we'll see how Ramda's path and pathOr functions can be used to safely access a deeply nested property from an object while avoiding the dreaded checks for undefined at each new property in the desired path.

ramda 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 ramda 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.

ramda 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 ramda 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.

ramda 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 ramda 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.

ramda tutorial about Convert Object Methods into Composable Functions with Ramda

Convert Object Methods into Composable Functions with Ramda

4:44 ramda 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.

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

Refactor a Promise Chain to Function Composition using Ramda

8:37 ramda 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.

ramda 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 ramda 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.

ramda 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 ramda 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.

ramda 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 ramda 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.

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

Debug Function Compositions with Ramda's Tap Function

2:48 ramda 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.

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

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

3:47 ramda 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.

ramda 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 ramda 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.

ramda 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 ramda 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.

ramda tutorial about Handle Errors in Ramda Pipelines with tryCatch

Handle Errors in Ramda Pipelines with tryCatch

2:32 ramda 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.

react tutorial about Update Component State in React With Ramda Lenses

Update Component State in React With Ramda Lenses

4:37 react PRO

In this lesson, we'll refactor a React component to use Ramda lenses to update our component state. We'll create a lens to focus on the property we want to target and use over to apply the existing state value to a utility function and we'll get back a new state that will be reflected in our rendered UI.

react tutorial about Update State in React with Ramda's Evolve

Update State in React with Ramda's Evolve

4:29 react PRO

In this lesson we'll take a stateful React component and look at how we can refactor our setState calls to use an updater function and then leverage Ramda's evolve function to make our updater function a reusable utility that isn't tied to the React API.

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