diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..f744573 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://gumroad.com/l/hGYGh diff --git a/README.md b/README.md index e18f688..9d442bc 100644 --- a/README.md +++ b/README.md @@ -84,3 +84,16 @@ The body of the request. // Return the sum of the a and b properties {a: 5, b: 1} setResult(body.a + body.b); + +## Async requests + +By default the event-code will automatically be finished by a response. +Here's how to do async requests: + + + var done = ctx.done // remember this to end the response (async) + ctx.done = function(){} // dummy function for autoresponse (sync) + + ctx.dpd.myresource.get({id: id}, function(result) { + done(result) + });