first 4
RxJS 5 first
HTML
<script src="https://npmcdn.com/@reactivex/[email protected]/dist/global/Rx.umd.js"></script>
JavaScript
const source = Rx.Observable.from([1,2,3,4,5]);
//no value will pass, emit default
const example = source.first(val => val > 5, val => `Value: ${val}`, 'Nothing');
//output: 'Nothing'
const subscribe = example.subscribe(val => console.log(val));