20 lines
341 B
TypeScript
20 lines
341 B
TypeScript
|
import { Observable } from "rxjs";
|
||
|
|
||
|
const observable = new Observable((s) => {
|
||
|
s.next('HALLO', 1234);
|
||
|
s.next('WELT', 1336);
|
||
|
});
|
||
|
|
||
|
observable.subscribe((...args) => console.log(...args));
|
||
|
|
||
|
function f<T>(func: T) {
|
||
|
console.log("f(): registered");
|
||
|
return func
|
||
|
}
|
||
|
|
||
|
|
||
|
export const x = f((a: number, b: number) => {
|
||
|
return a + b
|
||
|
})
|
||
|
|
||
|
x(1, 1)
|