Skip to content

Typescript + Angular (webpack) #52

@HarelM

Description

@HarelM

I have an issue with pouch db that causes the UI thread to be sluggish when using put().
I was hoping to use this plugin to fix this.
I had issues make PouchDB work and I hope this isn't the root cause.

  1. in tsconfig.json add "allowSyntheticDefaultImports": true
  2. import PouchDB from "pouchdb";
  3. let db = new PouchDB("db");
    So far the original setup which works on the UI thread.
    Now when doing the following
...
import "worker-pouch";
...
let db= new PouchDB("db", { adapter: "worker" });

I'm getting an error: Invalid Adapter: worker
When using:

var PouchDB = require('pouchdb');
PouchDB.adapter('worker', require('worker-pouch'));

I'm getting an error: PouchDB.adapter is not a function

I've also tried with PouchDB.plugin(require('worker-pouch')) but it didn't work too, something with immutable...

Help would be appreciated, I'm probably missing a simple thing...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions