Rewrite code to have BehaviorSubject subscribe with Observable
<p>I am learning Angular2 and RxJS and I'm following someone else's application. In his application, he has two modules. The first is the <code>asObservable.ts</code> file:</p>

<p><strong>asObservable.ts</strong></p>

<pre><code>export function asObservable(subject: Subject) {
    return new Observable(fn =&gt; subject.subscribe(fn));
}
</code></pre>

<p>The second is a file that creates a new <code>BehaviorSubject</code> RxJS object and sends it to the <code>asObservable.ts</code> module</p>

<p><strong>todo-store.service.ts</strong></p>

<pre><code>import {asObservable} from "./asObservable";
import {List} from "immutable";
import {Todo} from "./todo";
// Todo is a customized class

@Injectable()
export class TodoStore {

    private _todos: BehaviorSubject&lt;List&lt;Todo&gt;&gt; = new BehaviorSubject(List([]));

    get todos() {
        return asObservable(this._todos);
    }

    loadInitialData() {
        this.todoBackendService.getAllTodos()
            .subscribe(
                res =&gt; {
                    let todos = (&lt;Object[]&gt;res.json()).map((todo: any) =&gt;
                        new Todo({id:todo.id, description:todo.description, completed: todo.completed}));
                    this._todos.next(List(todos));
                },
                err =&gt; console.log("Error retrieving Todos")
            )
    }
    //unnecessary code omitted
 }
</code></pre>

<p>I would like to eliminate the <code>asObservable.ts</code> file and perform the subscribe function in a single function but I can't figure out how it would be done, something like:</p>

<pre><code>get todos() {
    return new Observable(Subject.subscribe(this._todos));
}
</code></pre>

<p>This obviously doesn't work. Could someone give me some pointers on the proper way to do this and a brief explanation of what I am doing wrong?</p>