0

The following doesn't work, because this is undefined.

    class Brain {
      private secret = 'Conquer World'
      public getPlan (s: string): TaskEither<Error, string> {
        return TE.right(`${s}: ${this.secret}`);
      }
    }

    const mouse = new Brain();

    const p = pipe(
      'mission',
      mouse.getPlan
    );

    const res = await p();

What is the correct way?

rollingBalls
  • 1,749
  • 1
  • 12
  • 23

0 Answers0