function Cache(propertyKey) {
	    return function (target, functionName, descriptor) {
	        var originalMethod = descriptor.value;
	        descriptor.value = function () {
	            var args = [];
	            for (var _i = 0; _i < arguments.length; _i++) {
	                args[_i - 0] = arguments[_i];
	            }
	            var key = getCacheKey(functionName, propertyKey, args);
	            var cache = cachedData[key];
	            if (cache && cache.data) {
	                return Rx.Observable.of(cache.data);
	            }
	            else if (cache && cache.observable) {
	                return cache.observable;
	            }
	            else {
	                cache = {
	                    observable: originalMethod.apply(this, args)
	                        .map(function (r) {
	                        delete cache.observable;
	                        cache.data = r;
	                        return cache.data;
	                    }).share()
	                };
	                cachedData[key] = cache;
	                return cache.observable;
	            }
	        };
	        return descriptor;
	    };
	}
/**
	 * Caches the returned Observable.
	 * The cache key used is either a property with the name ${propertyKey} from the first arg to the function.
	 * If propertyKey isn't specified or not there, then if the first arg is string, it's used as the key
	 * else we stringify the whole object.
	 *
	 * If there are no args passed to the function, then the function name is the key.
	 */
Caches the returned Observable.
The cache key used is either a property with the name ${propertyKey} from the first arg to the function.
If propertyKey isn't specified or not there, then if the first arg is string, it's used as the key
else we stringify the whole object.

If there are no args passed to the function, then the function name is the key.
Caches the returned Observable . The cache key used is either a property with the name $ { propertyKey } from the first arg to the function . If propertyKey isn ' t specified or not there then if the first arg is string it ' s used as the key else we stringify the whole object . If there are no args passed to the function then the function name is the key .
function Cache(propertyKey) {
	    return function (target, functionName, descriptor) {
	        var originalMethod = descriptor.value;
	        descriptor.value = function () {
	            var args = [];
	            for (var _i = 0; _i < arguments.length; _i++) {
	                args[_i - 0] = arguments[_i];
	            }
	            var key = getCacheKey(functionName, propertyKey, args);
	            var cache = cachedData[key];
	            if (cache && cache.data) {
	                return Rx.Observable.of(cache.data);
	            }
	            else if (cache && cache.observable) {
	                return cache.observable;
	            }
	            else {
	                cache = {
	                    observable: originalMethod.apply(this, args)
	                        .map(function (r) {
	                        delete cache.observable;
	                        cache.data = r;
	                        return cache.data;
	                    }).share()
	                };
	                cachedData[key] = cache;
	                return cache.observable;
	            }
	        };
	        return descriptor;
	    };
	}
function Cache ( propertyKey ) { return function ( target , functionName , descriptor ) { var originalMethod = descriptor . value ; descriptor . value = function ( ) { var args = [ ] ; for ( var _i = 0 ; _i < arguments . length ; _i ++ ) { args [ _i - 0 ] = arguments [ _i ] ; } var key = getCacheKey ( functionName , propertyKey , args ) ; var cache = cachedData [ key ] ; if ( cache && cache . data ) { return Rx . Observable . of ( cache . data ) ; } else if ( cache && cache . observable ) { return cache . observable ; } else { cache = { observable : originalMethod . apply ( this , args ) . map ( function ( r ) { delete cache . observable ; cache . data = r ; return cache . data ; } ) . share ( ) } ; cachedData [ key ] = cache ; return cache . observable ; } } ; return descriptor ; } ; }
Caches the returned Observable.
Caches the returned Observable .