Skip to content

Instantly share code, notes, and snippets.

View fourscience's full-sized avatar
🏠

David Földi fourscience

🏠
  • Budapest, Hungary
View GitHub Profile
function NOOP(){}
function Observable(subscriber = NOOP) {
function create(operand = v => v) {
return new Observable(observer => this.subscribe(v => {
let b = operand(v);
this.value = typeof b !== 'boolean' ? b : b && v;
this.value && observer.next(this.value);
})
);
}