Closed uvotguy closed 6 years ago
Hi
Are you writing the code in typescript ?
Btw - check out this : https://gist.github.com/ujjwalguptaofficial/d0289a52e1dc5175a157975b0c5fc1e5.
Hope this will help you. Let me know if its not.
Yes. I'm writing my code in TypeScript. I'll have a look at your post. Thank you!
This did not work. Stuck :-/
ok, are you getting the same error or something else ?
Same error.
oho ok. Can you look into this article - http://ujjwalguptaofficial.blogspot.in/2017/10/angular4-crud-operation-in-indexeddb.html and do as it says.
This is for angular but you will be able to understand how to make it work.
Will do. This is an Angular.js project. I'm using Vue.js (node). Are you suggesting I try creating an Angular project like this, or are you suggesting I start a new Vue project and implement this code?
I am suggesting that go through the article. You will get the concept of how to use it. Since you are using Typescript and article is also in ts, it will be helpful.
By the way - the whole concept will be to declare a var JsStore and use the code and include the jsstore file directly in index.html.
if you want to get intillisense support, import one one class like -
import {Instance} from 'JsStore' and use it as typing. See below screenshot for more help.
Basically in order to execute in web worker, there should not be any code which have dom or any other code which can not be excuted inside web worker. So if you will compile jsstore code with your others code, it wont be executed in web worker.
Thanks
Are you getting issue any more ?
Hi @uvotguy - please close this issue if you are not getting issue any more otherwise let me know - I will create a demo for you.
Thanks
@uvotguy - we have solved the problem in jsstore v2 - now you can write using es6, build with weback, also you can use in typescript, angular etc.
See examples in examples folder for more info and how to do this. Let me know if something is not working for you.
Thanks
Hello,
I'm building a Vue.js app and trying to use JsStore as my persistence mechanism. I define a TypeScript class like this:
When I try to instantiate my class like this:
var myDb = new testDb();
I get the following error:
Uncaught TypeError: WEBPACK_IMPORTED_MODULE_0_jsstore.Instance is not a constructor
Been banging my head over this. Any help would be appreciated.
Scott