DataAPI SDK english MT.DataAPI Core method withOptions - movabletype/mt-data-api-sdk-js GitHub Wiki
withOptions
Execute function with specified options.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| option | Option | yes | Option to overwrite |
| func | Function | yes | Function to execute |
Returns
: Return value of specified func
Example
// The DataAPI object is created with {async: true}
api.withOptions({async: false}, function() {
api.listEntries(1, function() {
// This is executed synchronously
});
});
api.listEntries(1, function() {
// This is executed asynchronously
});