-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
breaking-changeMay introduce breaking changesMay introduce breaking changesenhancementNew feature or requestNew feature or requestpriority: highHigh priority issueHigh priority issue
Description
Problem
The library currently only supports callbacks, which feels dated in modern JavaScript development.
Suggestion
- Make
send()return a Promise - Allow
await ajax.send()syntax - Maintain backward compatibility with existing callback system
Example API
// New Promise-based usage
const response = await ajax.send();
console.log(response.jsonResponse);
// Or with .then()
ajax.send().then(response => {
console.log(response.jsonResponse);
}).catch(err => {
console.error(err);
});Benefits
- Aligns with modern JS patterns
- Enables cleaner async/await code
- Better error handling with try/catch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking-changeMay introduce breaking changesMay introduce breaking changesenhancementNew feature or requestNew feature or requestpriority: highHigh priority issueHigh priority issue