common get post method, and control, edit page
This commit is contained in:
@@ -1,2 +1,41 @@
|
||||
const store: Record<string, string> = {};
|
||||
export default store;
|
||||
class Store {
|
||||
record: Record<string, string>;
|
||||
constructor() {
|
||||
this.record = {};
|
||||
}
|
||||
public get() {
|
||||
return this.record;
|
||||
}
|
||||
public set(key: string, val: string) {
|
||||
this.record[key] = val;
|
||||
}
|
||||
public delete(key: string) {
|
||||
delete this.record[key];
|
||||
}
|
||||
public update(record: Record<string, string>) {
|
||||
for (const key in record) {
|
||||
this.record[key] = record[key];
|
||||
}
|
||||
for (const key in this.record) {
|
||||
if (record[key] === undefined) {
|
||||
delete this.record[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class HTML {
|
||||
html: string;
|
||||
constructor() {
|
||||
this.html = "";
|
||||
}
|
||||
public get() {
|
||||
return this.html;
|
||||
}
|
||||
public set(html) {
|
||||
this.html = html;
|
||||
}
|
||||
}
|
||||
|
||||
export const html = new HTML();
|
||||
export const store = new Store();
|
||||
|
||||
Reference in New Issue
Block a user