Answer the question
In order to leave comments, you need to log in
How to comment on a method that returns a promise?
How to post a comment?
The rules are to write it like this:
/**
* Проверка файла. Возвращает true в промисе, если файл изменен.
* @return {Promise}
*/
checkPageFileChangeTime() {
let me = this;
return new Promise((resolve, reject) => {
if (!me._ctime) return resolve(true);
fs.stat(me._filename, (err, stats) => {
if (err) reject(err); else resolve(me._ctime < stats.ctime);
});
});
}
Answer the question
In order to leave comments, you need to log in
The data type can be specified like this:@return {Promise<boolean>}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question