Skip to content

Instantly share code, notes, and snippets.

View jefbarn's full-sized avatar

Jeff Barnes jefbarn

View GitHub Profile
@jefbarn
jefbarn / my_code.js
Created February 11, 2017 19:37
Using Pouchdb _selector plug-in
import PouchDB from 'pouchdb-browser' // Or however you are importing PouchDB using your module system
PouchDB.plugin((PouchDB) => { // Add the 'plug-in' to the Pouchdb instance
let pouchReplicate = PouchDB.replicate
PouchDB.replicate = (source, target, repOptions) => {
let sourceAjax = source._ajax
source._ajax = (ajaxOps, callback) => {
if (ajaxOps.url.includes('_selector')) {