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

Observable is not defined error while trying localForage.newObservable({}) #29

Open
PraveenRL opened this issue Mar 1, 2024 · 0 comments

Comments

@PraveenRL
Copy link

I'm working on Angular@16.2.1 with localforage@1.10.0 and localforage-observable@^2.1.1

Just following the same steps as in documentation, but getting error in localforage.newObservable(). Tried with different versions of localforage-observable also, but nothing works

import localForage from "localforage";
// OR based on your configuration:
// import * as localForage from "localforage";

import { extendPrototype } from "localforage-observable";

var localforage = extendPrototype(localForage);
localforage.ready().then(() => {
  // TypeScript will find `newObservable()` after the casting that `extendPrototype()` does
  var observable = localforage.newObservable();
});

Following error while running application:

Unhandled Promise rejection: Observable is not defined ; Zone: <root> ; Task: Promise.then ; Value: ReferenceError: Observable is not defined
    at newObservable.factory (localforage-observable.js:444:9)
    at LocalForage.newObservable (localforage-observable.js:431:40)
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

No branches or pull requests

1 participant