localForage / localForage/localForage-observable
Observable is not defined error while trying localForage.newObservable({})
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 88
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
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: ; 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)
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documented `extendPrototype()` and `newObservable()` example, then inspect the `newObservable.factory` and `LocalForage.newObservable` locations shown in `localforage-observable.js`. Reproduce the Angular 16.2.1 setup with localForage 1.10.0 and localforage-observable 2.1.1; done means creating the observable no longer raises `ReferenceError: Observable is not defined`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100