Skip to Content
Learning TypeScript 2.x - Second Edition
book

Learning TypeScript 2.x - Second Edition

by Remo H. Jansen
April 2018
Beginner content levelBeginner
536 pages
13h 21m
English
Packt Publishing
Content preview from Learning TypeScript 2.x - Second Edition

Ramda

In a real-world application, we don't need to create our own our FP utilities (for example, compose or curry functions). We can use existing JavaScript libraries that already implement these helpers and many others. One of these libraries is Ramda.

We can install Ramda using npm:

npm install --save ramda npm install --save-dev @types/ramda 

Ramda includes helper functions to implement function composition, currying, and many more FP techniques, and its API is influenced by the pointfree style.

The following code snippet re-implements the example that we used earlier in this chapter in the Currying section but uses the Ramda implementations of compose and currying, instead of using custom implementations:

import * as R from "ramda";const ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering TypeScript - Fourth Edition

Mastering TypeScript - Fourth Edition

Nathan Rozentals
Learning TypeScript

Learning TypeScript

Josh Goldberg
TypeScript for Beginners

TypeScript for Beginners

Bharath Thippireddy

Publisher Resources

ISBN: 9781788391474Supplemental Content