title: Can i pass outside function to RxJs subscribe?
body: <p>If i check RxJS subscribe method I can see that:</p>
  <pre><code>    subscribe(next?: (value: T) =&gt; void, error?: (error: any) =&gt; void, complete?: () =&gt; void): Subscription;
  </code></pre>
  <p>so I write example init function like this:</p>
  <pre><code>  private init(): void{
  this.dataBaseService.fetchPersons().subscribe(
     (persons: Person[]) =&gt; {
      this.behaviorSubject.next(persons);
      this.subject.next(persons);
    },
    error =&gt; console.error(error),
    () =&gt; console.log('Complete!')
  );
  </code></pre>
  <p>}</p>
  <p>is it required in Typescript to provide lambda function to argument? Can I create function somewhere else and provide it as argument?</p>
  <p>for example this function:</p>
  <pre><code>       (persons: Person[]) =&gt; {
      this.behaviorSubject.next(persons);
      this.subject.next(persons);
    }
  </code></pre>
  <p>create in upper class and then provide it as argument.</p>
  <p>Ok so I tried to create a method inside a class:</p>
  <pre><code>  someFunction( persons: Person[] ){
  this.behaviorSubject.next(persons);
  this.subject.next(persons);
  </code></pre>
  <p>}</p>
  <p>and tried to pass it to init function</p>
  <pre><code>    private init2(): void {
    this.dataBaseService.fetchPersons().subscribe(
      this.someFunction(),
      error =&gt; void,
      () =&gt; console.log('Complete!');
    )
  }
  </code></pre>
  <p>And I receive error:</p>
  <pre><code>An argument for 'persons' was not provided.
  </code></pre>
  <p>What kind of argument I have to provide if its initialisation of this upper method?</p>