]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/search/search.service.ts
Use typescript standard and lint all files
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / search / search.service.ts
index c7993db3dd05df9ba299dbb372e3300a0d398f42..0480b46bd8581bae90353948ae4142f32c95481f 100644 (file)
@@ -1,17 +1,18 @@
-import { Injectable } from '@angular/core';
-import { Subject } from 'rxjs/Subject';
+import { Injectable } from '@angular/core'
+import { Subject } from 'rxjs/Subject'
+import { ReplaySubject } from 'rxjs/ReplaySubject'
 
-import { Search } from './search.model';
+import { Search } from './search.model'
 
 // This class is needed to communicate between videos/ and search component
 // Remove it when we'll be able to subscribe to router changes
 @Injectable()
 export class SearchService {
-  searchUpdated: Subject<Search>;
-  updateSearch: Subject<Search>;
+  searchUpdated: Subject<Search>
+  updateSearch: Subject<Search>
 
-  constructor() {
-    this.updateSearch = new Subject<Search>();
-    this.searchUpdated = new Subject<Search>();
+  constructor () {
+    this.updateSearch = new Subject<Search>()
+    this.searchUpdated = new ReplaySubject<Search>(1)
   }
 }