Add remoteStorage.js and Places module
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled

This commit is contained in:
2026-01-15 20:45:07 +07:00
parent 283b73e0e6
commit caa48537bc
8 changed files with 127 additions and 22 deletions

28
app/services/storage.js Normal file
View 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;
}
}

View File

@@ -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;