VersionCheck.getLatestVersion({
provider: () => fetch('http://your.own/api')
.then(r => r.json())
.then(({version}) => version), // You can get latest version from your own api.
}).then(latestVersion =>{
console.log(latestVersion);
});
It says
Type '() => Promise' is not assignable to type 'string | (() => string) | undefined'.
Type '() => Promise' is not assignable to type '() => string'.
Type 'Promise' is not assignable to type 'string'.
Hi,
I have this error with typescript with provider
VersionCheck.getLatestVersion({ provider: () => fetch('http://your.own/api') .then(r => r.json()) .then(({version}) => version), // You can get latest version from your own api. }).then(latestVersion =>{ console.log(latestVersion); });
It says Type '() => Promise' is not assignable to type 'string | (() => string) | undefined'.
Type '() => Promise' is not assignable to type '() => string'.
Type 'Promise' is not assignable to type 'string'.