Combining firebase observables with angular2
<p>I'm working on an angular2 - firebase app, and was wondering on some best rxjs practices, that I find difficult to google. </p>

<p>Say I have a class "Project" with properties like "name", "$key", etc. And then also arrays of "Note[]" and "Task[]"</p>

<p>"Note" and "Task" are then their own classes.</p>

<p>Initially I structured data in firebase like this:</p>

<ul>
<li>Project

<ul>
<li>Name</li>
<li>Tags</li>
<li>Other meta stuff</li>
<li>Tasks

<ul>
<li>Task1</li>
<li>Task2, etc</li>
</ul></li>
<li>Notes

<ul>
<li>Note1</li>
<li>Note2, etc</li>
</ul></li>
</ul></li>
</ul>

<p>I would get one data stream and use map to get the data to look exactly how I want it.</p>

<p>But then I realised that this is bad practice and the project trees should be as flat as possible so that I wouldn't be forced to load everything when I just need the project metadata for example.</p>

<p>So I restructured it to be like this:</p>

<ul>
<li>Projects

<ul>
<li>Project1

<ul>
<li>Name</li>
<li>Tags</li>
<li>etc</li>
</ul></li>
<li>Project2

<ul>
<li>Name</li>
<li>Tags</li>
<li>etc</li>
</ul></li>
</ul></li>
<li>Tasks

<ul>
<li>Project1

<ul>
<li>Task1

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
<li>Task2

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
</ul></li>
<li>Project2

<ul>
<li>Task1

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
<li>Task2

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
</ul></li>
</ul></li>
<li>Notes

<ul>
<li>Project1

<ul>
<li>Note1

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
<li>Note2

<ul>
<li>Name</li>
<li>Body</li>
</ul></li>
</ul></li>
</ul></li>
</ul>

<p>So this way I get three data streams of "Projects" "Notes" and "Tasks".
It seems to make sense to combine this into a single stream of "Projects" with "Notes" and "Tasks" inside it.</p>

<p>Although I'm unsure of what's the best way to do that? 
I wrote a long function that concatMaps everything into and array of "Project[]", but now I'm left with an array instead of a stream, which definitely seams wrong.</p>

<p>Or maybe it's a wrong approach altogether? </p>

<p>Looking forward to your thoughts.
Thanks!
H</p>