Skip to content

Commit

Permalink
Add getter and setter for browserStorage on Model
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Nov 10, 2023
1 parent 81b33ec commit 0cc6669
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ class Model extends EventEmitter(Object) {
this.changed = {};
}

/**
* @param {Storage} storage
*/
set browserStorage(storage) {
this._browserStorage = storage;
}

/**
* @returns {Storage} storage
*/
get browserStorage() {
return this._browserStorage;
}

/**
* The default name for the JSON `id` attribute is `"id"`. MongoDB and
* CouchDB users may want to set this to `"_id"` (by overriding this getter
Expand Down
9 changes: 9 additions & 0 deletions src/types/model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ export class Model extends Model_base {
validate: any;
collection: any;
changed: {};
/**
* @param {Storage} storage
*/
set browserStorage(arg: Storage);
/**
* @returns {Storage} storage
*/
get browserStorage(): Storage;
_browserStorage: Storage;
/**
* The default name for the JSON `id` attribute is `"id"`. MongoDB and
* CouchDB users may want to set this to `"_id"` (by overriding this getter
Expand Down
2 changes: 1 addition & 1 deletion src/types/model.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0cc6669

Please sign in to comment.