refactor @saveable to @svDb()

This commit is contained in:
2016-11-18 13:56:15 +01:00
parent 63ceded1b8
commit 7079340657
6 changed files with 21 additions and 17 deletions

View File

@@ -8,10 +8,12 @@ export type TDocCreation = 'db' | 'new' | 'mixed'
/**
* saveable - saveable decorator to be used on class properties
*/
export function saveable(target: DbDoc<any>, key: string) {
console.log('called sva')
if (!target.saveableProperties) { target.saveableProperties = [] }
target.saveableProperties.push(key)
export function svDb() {
return (target: DbDoc<any>, key: string) => {
console.log('called sva')
if (!target.saveableProperties) { target.saveableProperties = [] }
target.saveableProperties.push(key)
}
}
export class DbDoc<T> {