Argument of type '(snap: DataSnapshot) => void' is not assignable to parameter of type '(a: DataSnapshot) => boolean'

后端 未结 2 1051
走了就别回头了
走了就别回头了 2020-12-11 02:24

I\'ve already read several questions and answers about this problem but wasn\'t able to solve it.

I\'m using Ionic2 and I have a method which retrieves data from Fir

2条回答
  •  误落风尘
    2020-12-11 03:00

    For Typescript version I came out with this solution:

    db
      .ref(`jobs`)
      .orderByChild("counter")
      .on("value", (querySnapshot) => {
        const jobs: any[] = [];
        querySnapshot.forEach((jobRef) => {
          jobs.push(jobRef.val());
        });
        jobs.forEach(async (job) => {
          await minuteRT(job);
        });
        res.status(200).send("done!");
      });
    

提交回复
热议问题