Add LiveQuery

This commit is contained in:
wangmengyan95
2016-03-10 14:27:00 -08:00
parent cf3606246f
commit 555e25bf33
33 changed files with 3580 additions and 48 deletions

22
src/LiveQuery/Id.js Normal file
View File

@@ -0,0 +1,22 @@
class Id {
className: string;
objectId: string;
constructor(className: string, objectId: string) {
this.className = className;
this.objectId = objectId;
}
toString(): string {
return this.className + ':' + this.objectId;
}
static fromString(str: string) {
var split = str.split(':');
if (split.length !== 2) {
throw new TypeError('Cannot create Id object from this string');
}
return new Id(split[0], split[1]);
}
}
module.exports = Id;