This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type preFunc<T> = (target: T, propertyName: keyof T, args: any[], receiver: any) => void; | |
export type postFunc<T> = (target: T, propertyName: keyof T, args: any[], result: any, didError: boolean, duration: number, receiver: any) => void; | |
function postDefault<T extends object>(target: T, propertyName: keyof T, args: any[], result: any, didError: boolean, duration: number, receiver: any) { | |
console.log(`${target.constructor.name}.${propertyName.toString()} - duration: ${duration}ms ${didError ? '[with Error]' : ''}`); | |
} | |
/** | |
* wrap any object in a proxy that will expose pre and post handlers with a built in timer | |
* @param source the object to proxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../google-map/google-map.html"> | |
<link rel="import" href="../cool-clock/cool-clock.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |