Skip to content

yasaichi-sandbox/that

 
 

Repository files navigation

That

that is user-space implementation for call-this, inspired by Call-this operator for JavaScript proposal.

Examples

function increment(this: number): number {
    return this + 1;
}

function add(this: number, another: number): number {
    return this + another;
}

that(8)
    .call(increment)
    .call(add, 5)
    .call(add, 9)
    .unwrap();
// => 23

that("Hello, world")
    .call$(($) => $.split(" ")) // that(["Hello,", "world"])
    .call$(($) => $.length) // that(2)
    .call(increment) // that(3)
    .unwrap()
// => 3

Installation

that is not published yet.

About

user-space call-this chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 94.4%
  • JavaScript 5.6%