Skip to content

Commit

Permalink
refactor(menu): replace item click ReplaySubject with plain Subject (#…
Browse files Browse the repository at this point in the history
…724)

BREAKING CHANGE:

The `NbMenuService` not reply the last click event.

To Update:
if you use the knowledge that the last click event is replied you can wrap `onItemClick` stream in the custom stream based on `ReplaySubject`.

Closes #695
  • Loading branch information
tibing-old-email authored and nnixaa committed Sep 20, 2018
1 parent 23e7804 commit eb6e74b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/framework/theme/components/menu/menu.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import { Injectable } from '@angular/core';
import { Location } from '@angular/common';
import { Params } from '@angular/router';
import { Observable, BehaviorSubject, ReplaySubject } from 'rxjs';
import { Observable, BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
import { share } from 'rxjs/operators';
import { isUrlPathContain, isUrlPathEqual } from './url-matching-helpers';

export interface NbMenuBag { tag: string; item: NbMenuItem }

const itemClick$ = new ReplaySubject<NbMenuBag>(1);
const itemClick$ = new Subject<NbMenuBag>();
const addItems$ = new ReplaySubject<{ tag: string; items: NbMenuItem[] }>(1);
const navigateHome$ = new ReplaySubject<{ tag: string }>(1);
const getSelectedItem$
Expand Down

0 comments on commit eb6e74b

Please sign in to comment.