Error message

  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /home/onlinede/public_html/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /home/onlinede/public_html/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /home/onlinede/public_html/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /home/onlinede/public_html/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /home/onlinede/public_html/includes/database/query.inc).

Node js example of async promise await

router.get("/async-await", async function(req, res){  

   try {

   const data = await pullData();

   const userData = await getUser(data);

   res.json(data);

   }catch(err) {

      console.error(err);

 

   }

});

 

function pullData () {

   return new Promise((resolve, reject) => {

     setTimeout(function () {

       console.log('Pull Data function done')

       resolve()

     }, 1000)

   })

 }

 

 function getUser () {

   return new Promise((resolve, reject) => {

     setTimeout(function () {

       console.log('User function done')

       resolve()

     }, 1000)

   })

 }