Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to use in web worker #84

Open
mslourens opened this issue Jul 13, 2018 · 0 comments
Open

Not possible to use in web worker #84

mslourens opened this issue Jul 13, 2018 · 0 comments

Comments

@mslourens
Copy link

mslourens commented Jul 13, 2018

It is not possible to run pouchdb-quick-search in a web worker, because at the end of the script this line of code is executed:

if (typeof window !== 'undefined' && window.PouchDB) {
  window.PouchDB.plugin(exports);
}

In a web worker process window is not defined, so the plugin is never added to PouchDb. I would suggest you use the way the pouchdb-find plugin is added:

if (typeof PouchDB !== 'undefined') {
  PouchDB.plugin(exports);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant