feat(web-workers) Add WebWorker Renderer
Allows angular apps to be rendered from the webworker! Closes #3052, #3053, and #3097
This commit is contained in:
@ -39,6 +39,19 @@ bool isDate(obj) => obj is DateTime;
|
||||
|
||||
String stringify(obj) => obj.toString();
|
||||
|
||||
int serializeEnum(val) {
|
||||
return val.index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes an enum
|
||||
* val should be the indexed value of the enum (sa returned from @Link{serializeEnum})
|
||||
* values should be a map from indexes to values for the enum that you want to deserialize.
|
||||
*/
|
||||
dynamic deserializeEnum(int val, Map<int, dynamic> values) {
|
||||
return values[val];
|
||||
}
|
||||
|
||||
class StringWrapper {
|
||||
static String fromCharCode(int code) {
|
||||
return new String.fromCharCode(code);
|
||||
|
@ -130,6 +130,17 @@ export function stringify(token): string {
|
||||
return (newLineIndex === -1) ? res : res.substring(0, newLineIndex);
|
||||
}
|
||||
|
||||
// serialize / deserialize enum exist only for consistency with dart API
|
||||
// enums in typescript don't need to be serialized
|
||||
|
||||
export function serializeEnum(val): int {
|
||||
return val;
|
||||
}
|
||||
|
||||
export function deserializeEnum(val, values: Map<int, any>): any {
|
||||
return val;
|
||||
}
|
||||
|
||||
export class StringWrapper {
|
||||
static fromCharCode(code: int): string { return String.fromCharCode(code); }
|
||||
|
||||
|
Reference in New Issue
Block a user