I think what the answers here are missing is that you are using a BehaviourSubject, which is the wrong type of subject.
In short :
A Subject will output values only from the time you subscribe. So if emit is called on a Subject 5 times, then a component subscribes, they won't see those previous 5 emits.
A ReplaySubject will output X amount of values immediately when you subscribe. So if I have a ReplaySubject(1), and I output a value 5 times, then a component subscribes. They will immediately receive the last 1 value, then they will continue to receive further emits.
A BehaviourSubject is almost identical to a ReplaySubject except it has a default value that will always be emitted, regardless of whether you have called emit on the subject.
In your code you have :
companiesList$ = new BehaviorSubject([]);
So even before you call emit, anyone who subscribes to this will immediately receive an empty array. So I think reading between the lines of your question, you are having issues receiving an empty array when you subscribe, then you are receiving your actual data.
You can resolve this by using a ReplaySubject :
companiesList$ = new ReplaySubject(1);
Which will output nothing until the first emit, then any subscribes will always receive this "last" emit.
It's worth learning the differences of each type of Subject here : https://tutorialsforangular.com/2020/12/12/subject-vs-replaysubject-vs-behaviorsubject/
BehaviorSubject). You already have an Observable you can work with. Consider trying a declarative approach to your Observables. That will make notifications easier. See this for more information: youtube.com/watch?v=Z76QlSpYcck - DeborahK