Jump to content


Photo

Awaiting the inspectItem method callback


  • Please log in to reply
2 replies to this topic

#1 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 06 April 2019 - 05:38 PM

I'm using inspectItem in an array for loop, it seems like the callback is sometimes empty. Right now I'm using a setTimeout() function to delay each method by 1s, however I'd rather iterate through the for loop when the promise is fulfilled.

 

 



#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,140 posts

Posted 06 April 2019 - 09:40 PM

If it's empty then you're probably sending the request too quickly.



#3 Acorn Eyes

Acorn Eyes

    Member

  • Member
  • PipPip
  • 15 posts

Posted 07 April 2019 - 06:10 PM

If it's empty then you're probably sending the request too quickly.

I figured, I'm just  wondering why the callback only handles if there is one.

if (callback) {
	this.once('inspectItemInfo#' + assetid, callback);
}

I would have expected a failed response if there isn't one. 

callback ? this.once('inspectItemInfo#' + assetid, callback) : return Null

something like that.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users