I'm calling this function within an event service.
searchSessions = (searchTerm: string): Observable<ISession[]> => {
    var term = searchTerm.toLocaleLowerCase();
    var results: ISession[] = [];
    EVENTS.forEach(event => {
        var matchingSessions = event.sessions.filter(session => session.name.toLocaleLowerCase().indexOf(term) > -1);
        results = results.concat(matchingSessions);
    })
    var emitter = new EventEmitter(true);
    setTimeout(() => {
        emitter.emit(results);
    }, 100);
    return emitter;
}
Using this function in my component
searchSessions(searchTerm: string) {
    this._eventService.searchSessions(searchTerm).subscribe(sessions => {
        this.foundSessions = sessions;
    });
    console.log(this.foundSessions);
}
However every time it's called it seems to be returning the results from the last attempt, so I'm always a search behind. I've tried stepping through it but I just can't work out what the problem is. Any help would be greatly appreciated.
Cheers,
Z
