Skip to content

Instantly share code, notes, and snippets.

View cvuorinen's full-sized avatar
🕸️
Inthewebs

Carl Vuorinen cvuorinen

🕸️
Inthewebs
View GitHub Profile
@cvuorinen
cvuorinen / asyncFilter.js
Last active April 19, 2016 23:41
asyncFilter.js - {{ observableOrPromise | async }}
angular
.module('asyncFilter', [])
.filter('async', function() {
const values = {};
const subscriptions = {};
function async(input, scope) {
// Make sure we have an Observable or a Promise
if (!input || !(input.subscribe || input.then)) {
return input;