9 lines
246 B
TypeScript
9 lines
246 B
TypeScript
function sendRequest(data: string, cb: (response: any) => void) {
|
|
// ... sending a request with "data"
|
|
return cb({data: 'Hi there!'});
|
|
}
|
|
|
|
sendRequest('Send this!', (response) => {
|
|
console.log(response);
|
|
return true;
|
|
}); |