Skip to content

Instantly share code, notes, and snippets.

View noahgrant's full-sized avatar

Noah Grant noahgrant

View GitHub Profile
@noahgrant
noahgrant / backbone.fetch.js
Last active November 8, 2018 16:09 — forked from akre54/backbone.fetch.js
Backbone.ajax with window.fetch
import _ from 'underscore';
import Backbone from 'backbone';
import {stringify} from 'qs';
const backboneSync = Backbone.sync.bind(Backbone);
const MIME_TYPE_JSON = 'application/json';
const MIME_TYPE_DEFAULT = 'application/x-www-form-urlencoded; charset=UTF-8';
Backbone.sync = (method, model, options) => {