Closed jacek-jablonski closed 5 years ago
It looks to me as some syntax issue. From error message it's clear that there's no getUser
method accessible from context of fetchProfile
method.
I'm not perfectly familiar with TS syntax, so it's hard for me to help you.
Also memoizee
is a plain JS project, and here code snippets should also be posted in plain JS (one that runs with no transpilation in modern engines).
I suggest to post it on Stack Overflow, and address TypeScript community with that question. They definitely will help you solve this.
You can try
getUser = () => memoize(UserAPI.getUser, { maxAge: 10 60 1000, promise: true })
Hi I would like to use memoizee in TypeScript's class, f.e.:
However, it complains that: I have
TypeError: this.getUser is not a function
. Why is that? What is proper usage of memoizee in TypeScript's classes?