add resId to cache DoricResource on native
This commit is contained in:
2
doric-js/lib/src/util/resource.d.ts
vendored
2
doric-js/lib/src/util/resource.d.ts
vendored
@@ -2,8 +2,10 @@ import { Modeling } from "./types";
|
||||
export declare abstract class Resource implements Modeling {
|
||||
type: string;
|
||||
identifier: string;
|
||||
resId: string;
|
||||
constructor(type: string, identifier: string);
|
||||
toModel(): {
|
||||
resId: string;
|
||||
type: string;
|
||||
identifier: string;
|
||||
};
|
||||
|
@@ -1,10 +1,13 @@
|
||||
import { uniqueId } from "./uniqueId";
|
||||
export class Resource {
|
||||
constructor(type, identifier) {
|
||||
this.resId = uniqueId("resource");
|
||||
this.type = type;
|
||||
this.identifier = identifier;
|
||||
}
|
||||
toModel() {
|
||||
return {
|
||||
resId: this.resId,
|
||||
type: this.type,
|
||||
identifier: this.identifier,
|
||||
};
|
||||
|
Reference in New Issue
Block a user