pouchdb / upsert

PouchDB plugin for upsert() and putIfNotExists() functions
Apache License 2.0
149 stars 25 forks source link

add: expose self as pouchdbUpsert and bind to self #21

Closed zhuangya closed 8 years ago

zhuangya commented 8 years ago

so we can use this lib in webworks =)

ref nolanlawson/pouchdb-find#200

nolanlawson commented 8 years ago

See my comment in https://github.com/nolanlawson/pouchdb-find/pull/200#issuecomment-229388923 ; we could definitely try to detect all global usages of PouchDB in every possible env, but I try to avoid doing so because it's a slippery slope, thanks for understanding. :)

zhuangya commented 8 years ago

well, if do not generate/pack the script in "standalone" mode, there is no way to importScripts and apply it to PouchDB as far as i can see. i fully understand your concertn, but maybe browserify the script in standalone with with -s pouchdbUpsert ?

nolanlawson commented 8 years ago

Yes, just browserify and insert into your worker, that's what I would do. TBH we should have made our own bundle a standalone UMD bundle, and the fact that we didn't is a bug. I'll fix that.

nolanlawson commented 8 years ago

fixed in 2.0.2 now