import { of } from 'rxjs'; 
import { map, tap } from 'rxjs/operators';

const source = of('World').pipe(
  map(x => `Hello ${x}!`)
);
source.subscribe(console.log);
 

of(1,2,3).pipe(
 // ‘x’ aangepast naar tekst met x erin, let op komma:
 map(x => { return `Prachtige waarde: ${x}` }),
 tap(x => console.log("Ik log alleen even!" + x))
).subscribe(
 data=>{ console.log(data) },
 err=> { console.log('Er ging iets mis'); }
);


const source2 = of(1, 2, 3, { name: 'Brian' }, [1, 2, 3], function hello() { return 'Hello';});
const subscribe = source2.subscribe(val => console.log(val));


// https://www.learnrxjs.io/learn-rxjs/operators/creation/of
of(1, 2, 3, { name: 'Brian' }, [1, 2, 3], function hello() { return 'Hello';}).pipe(
 map(x => { return `Waarde: ${x}` }),
 tap(x => console.log("Logging: " + x))
).subscribe(
 data=>{ console.log(data) },
 err=> { console.log('Er ging iets mis'); }
);
