0
0

More than 3 years have passed since last update.

[Node.js] メソッド使おうとしたらあるはずなのにないよって言われた

Last updated at Posted at 2020-04-07

環境

node:v8.11.3

あかんプログラム

nogizaka-suko.js
getHogeData: function(user_id, callback) {
    //なんかいろいろ
},
getAllUsers: function () {
    return new Promise(function (resolve, reject) {
        //いろんな処理する
        this.getHogeData(user_id, なんかコールバック);
        //いろんな処理する
    });
},


解決方法

Promiseというより二重のfunctionで囲まれた状態でthis使っていたのがまずかったのでやめた

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0