What is meaning of this piece of code in typescript?
const storeDocumentId = documentId => this.preselectedDocumentId = documentId;
If storeDocumentId is a function how it is getting argument because it is called without argument. Please see function code below.
public watchViewerRouteChanges(activatedRoute: ActivatedRoute): void {
this.unwatchViewerRouteChanges();
const storeDocumentId = documentId => this.preselectedDocumentId = documentId;
const provideDocumentId = () => activatedRoute.snapshot.firstChild.params[QUERY_PARAMS.documentKey];
const provideDocument = documentId => documentId ? this.documentContentsService.getDocumentMetadata(documentId, false) : Observable.of<ToCEntry>(null);
this.viewerRouteChangeSubscription = this.router.events
.map(provideDocumentId)
.distinctUntilChanged()
.do(storeDocumentId)
.do(() => this.showDocumentContentsHeader = false)
.switchMap(provideDocument)
.subscribe(selectDocument);
}