Add remoteStorage.js and Places module
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
This commit is contained in:
28
app/services/storage.js
Normal file
28
app/services/storage.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import Service from '@ember/service';
|
||||
import RemoteStorage from 'remotestoragejs';
|
||||
import Places from '@remotestorage/module-places';
|
||||
import Widget from 'remotestorage-widget';
|
||||
|
||||
export default class StorageService extends Service {
|
||||
rs;
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
console.log('ohai');
|
||||
|
||||
this.rs = new RemoteStorage({
|
||||
modules: [Places],
|
||||
});
|
||||
|
||||
this.rs.access.claim('places', 'rw');
|
||||
this.rs.caching.enable('/places/');
|
||||
|
||||
window.remoteStorage = this.rs;
|
||||
// const widget = new Widget(this.rs);
|
||||
// widget.attach();
|
||||
}
|
||||
|
||||
get places() {
|
||||
return this.rs.places;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import { useLegacyStore } from '@warp-drive/legacy';
|
||||
import { JSONAPICache } from '@warp-drive/json-api';
|
||||
|
||||
const Store = useLegacyStore({
|
||||
linksMode: true,
|
||||
cache: JSONAPICache,
|
||||
handlers: [
|
||||
// -- your handlers here
|
||||
],
|
||||
schemas: [
|
||||
// -- your schemas here
|
||||
],
|
||||
});
|
||||
|
||||
export default Store;
|
||||
Reference in New Issue
Block a user