
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@moos/backbone-fetch
Advanced tools
Backbone Model CRUD operations
using ES6 fetch API. Can be used without jQuery
or jQuery.ajax
.
npm i @moos/backbone-fetch
Or get it from jsDelivr CDN...
Latest:
Versioned (recommemded in production):
require('backbone');
Backbone.ajax = require('@moos/backbone-fetch'); // or use <scrip>
let model = new Backbone.Model({foo: 1});
model.save()
.then(response => {...})
.catch(error => {...});
Similar for other Backbone CRUD operations: fetch()
& destroy()
.
Note: it returns an ES6 Promise. Use polyfill for older browsers.
To pass body and headers:
model.save(null, {
data: {...} // JSON data to pass in HTTP body
headers: {
'Accept': 'application/json'
}
})
.then(response => {...})
.catch(error => {...});
If AbortController is supported (sorry IE or use a polyfill), the returned promise will have an abort()
method:
var promise = model.fetch();
// a little later...
promise.abort();
The success of abort depends on the state of the fetch call at the time abort was called. According to AbortController/abort() docs, "when abort() is called, the fetch() promise rejects with an AbortError."
ICS
FAQs
Backbone Models without jQuery.ajax
The npm package @moos/backbone-fetch receives a total of 0 weekly downloads. As such, @moos/backbone-fetch popularity was classified as not popular.
We found that @moos/backbone-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.