Skip to content

Commit efb498d

Browse files
Update onBeforeSend d.ts and docs (#566)
1 parent 65af792 commit efb498d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

docs/client-side-with-jquery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ When you call the `DevExpress.data.AspNet.createStore` method, pass an object wi
9090
- `onBeforeSend` - a function that customizes the request before it is sent.
9191
9292
```js
93-
onBeforeSend: (operation, ajaxSettings) => void
93+
onBeforeSend: (operation, ajaxSettings) => void | PromiseLike
9494
```
9595
9696
Parameter | Type | Description

js-test/check-ts-compilation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,11 @@ AspNetData.createStore({
3838

3939
onPush: (changes) => console.log(changes.length)
4040
})
41+
42+
AspNetData.createStore({
43+
onBeforeSend: () => "any" // backward compatibility
44+
});
45+
46+
AspNetData.createStore({
47+
onBeforeSend: Promise.resolve
48+
});

js/dx.aspnet.data.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface Options {
2020
loadMode?: "processed" | "raw",
2121
cacheRawData?: boolean,
2222

23-
onBeforeSend?: (operation: string, ajaxSettings: JQueryAjaxSettings) => void,
23+
onBeforeSend?: (operation: string, ajaxSettings: JQueryAjaxSettings) => void | PromiseLike<any>| any,
2424
onAjaxError?: (e: { xhr: JQueryXHR, error: string | Error }) => void
2525

2626
onLoading?: (loadOptions: any) => void;

0 commit comments

Comments
 (0)