Questions tagged [asynccallback]

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

A callback is a piece of executable code that is passed as an argument to other code, which is expected to call back (execute) the argument at some convenient time. An asynchronous or deferred callback is invoked after a function returns, or at least on another thread’s stack.

More Info

457 questions
-1
votes
1 answer

Refactor non-standard library callback into promise

I am using the fabricjs package and want to make use of the fabric.Image.fromURL function. The documentation for this function is below: (static) fromURL(url, callbackopt, imgOptionsopt) Creates an instance of fabric.Image from an URL…
C_Z_
  • 7,427
  • 5
  • 44
  • 81
-1
votes
1 answer

How do I use global 'window' in Angular?

I want to use "window["initMapCallback"] to call and listen for "initMapCallback" in another file, but I'm getting an error in the debug window that says Question - How do I correctly use this as "window["initMapCallback"] = function()" is not being…
chuckd
  • 13,460
  • 29
  • 152
  • 331
-1
votes
1 answer

Fetching results(location Data) from leaflet Geocoder through callback function

I am working on an angular project that uses leaflet framework for implementing geocoder. My current requirement is to use geocoder, retrieve the lat,lng from the results and emit them to the parent component which would then trigger an event in the…
-1
votes
1 answer

Returning value from a callback function in nodejs

I have a function in this way function con(){ database.connect(con, (err, con) => { conn.query("select * from person", (err, rs) => { console.log(rs)--->result return rs }) } } var val =…
-1
votes
1 answer

React.js, how to use map and async functions with setState callback?

In my React app, i need to call 2 different functions successively for each records in my map results. by calling the function getOrderLine() and regarding the number of records, I want to call successively the functions getItemInfo() and…
-1
votes
1 answer

How to properly test a method that contains several async callbacks in Node.js?

I am relatively new at Node.js. Now I am writing my unit test with Mocha and Chai and found myself stuck when it comes to test the code inside anonymous functions that are written as callbacks for async functions. I recreated some example code to…
-1
votes
1 answer

Callback in a callback should return a promise

I would like to resolve a promise (the code is below) and assign the result to the qrCode variable. const qrCode: string = await ... ?; // some async method here...? QRScanner.prepare((err: QRScannerError, status: QRScannerStatus) => { …
str1ct
  • 33
  • 1
  • 6
-1
votes
1 answer

Javascript access variable in self invoking function

I am trying to assign a value to a variable at the parent function level through some nested self-invoking functions. I am new to javascript coding and am having some trouble getting the value of the variable out of the nested function. Is the value…
-1
votes
1 answer

How to avoid loosing 'this' in the callbacks?

Object on which a function is called gets lost subsequently in the callbacks. How could I preserve/maintain the object on which the function was called. var javaci = new…
Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
-1
votes
1 answer

Koush Ion onCompleted callback - handle CancellationException

I am following an example of the popular Ion library that Koush created: Download a File with a progress bar and I can see from one of his samples that it is possible to send a cancellation using downloading.cancel(). NB: downloading was declared as…
WizzKidd
  • 196
  • 8
-1
votes
2 answers

Blocking UI thread in javascript

The context here is I check whether the device's location is on or off. If it is off it gives a alert dialog to go to location settings. On click of Proceed button a call back is made to the successAlert function(below code). Once it enters…
pradeepln4
  • 131
  • 1
  • 2
  • 9
-1
votes
1 answer

NodeJS - Promise callback response [SyntaxError: Unexpected end of input]

I created the following NodeJS function. The issue I'm getting is, when I'm executing this code like: someFunc(parameter) .then(function(doSomething){ //do something here, which works fine here. }) //The following function works and is very…
AKS
  • 16,482
  • 43
  • 166
  • 258
-1
votes
2 answers

Ajax-Request in a Callback-Function (with loop)

My AJAX request always sends the same data. How can I use the convertImgToBase64 function without this issue? $imageMaps[0] = '1.jpeg'; $imageMaps[1] = '2.jpeg'; for (var k in $imageMaps) { $file = $imageMaps[k] convertImgToBase64($url,…
dazzafact
  • 2,570
  • 3
  • 30
  • 49
-1
votes
1 answer

Asynchronous Database Problems with Node.js

I am trying to query a database, running on a node server without express using sqlite3, to check if an element is in the database. Upon finding if this element exists, it will then go on to access a different table with this information. var…
-1
votes
1 answer

Identifying last subscribed event of EventHandler c#

I have a silver light application, where a service method is called asynchronously. I am required to identify the last subscribed event and perform a specific operation. For an example like below. foreach(var proj in lstProj) { …
Darey
  • 497
  • 4
  • 24
1 2 3
30
31