Partial application

Partial application is an FP technique that allows us to pass the arguments required by a function at different points in time.

This technique can feel like a weird idea at first glance because most software engineers are used to the idea of applying (also known as invoking) a function at one unique point in time (complete application), as opposed to applying a function at multiple points in time (partial application).

The following code snippet implements a function that doesn't support partial application and invokes it (providing all the required arguments) at one single point in time:

function add(a: number, b: number) { return a + b; } const result = add(5, 5); // All arguments are provided at the same time console.log(result); ...

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.