Skip to content

Instantly share code, notes, and snippets.

Avatar
🕸️
Inthewebs

Carl Vuorinen cvuorinen

🕸️
Inthewebs
View GitHub Profile
@cvuorinen
cvuorinen / asyncFilter.js
Last active Apr 19, 2016
asyncFilter.js - {{ observableOrPromise | async }}
View asyncFilter.js
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;