0
import { Observable, of } from 'rxjs';

let myobs:Observable<string[]> = () => {
    return of("test", "test2", "test3");
};

This is code I wrote with some limited understanding of rxjs. I am trying to conceptualize what is going on, so I tried to create an Observable of type Array<string> that will simply return the stream of strings specified in the return statement.

I am receiving an error that says I am missing _isScalar, source, operator, lift, and 6 more... what would be the correct syntax, and more importantly: what am I missing to fill in my gap of knowledge that will let my "demo" work?

  • Might or might not exactly what he wants. See the differences [here](https://stackoverflow.com/questions/42704552/of-vs-from-operator#answer-46093191). – peinearydevelopment Jan 15 '20 at 19:43

1 Answers1

1

It is most likely upset that you aren't giving it an array.

import { Observable, of } from 'rxjs'; 

 let myobs:Observable<string[]> = of(["test", "test2", "test3"]);

Example on StackBlitz

peinearydevelopment
  • 11,042
  • 5
  • 48
  • 76