feat(data): show skeleton screens before data is loaded

Closes #4
This commit is contained in:
Jovan Krunić
2019-04-24 09:11:24 +02:00
committed by Sebastian Lange
parent 88f87a2ce1
commit e1039aa226
10 changed files with 102 additions and 39 deletions

View File

@@ -17,7 +17,7 @@ import {HTTP_INTERCEPTORS, HttpClient,
import {Injectable} from '@angular/core';
import {SCIndexResponse, SCThingType} from '@openstapps/core';
import {Observable, of} from 'rxjs';
import {map} from 'rxjs/operators';
import {map, delay} from 'rxjs/operators';
import {SampleThings} from './data/sample-things';
const sampleIndexResponse: SCIndexResponse = {
@@ -150,12 +150,12 @@ export class FakeBackendInterceptor implements HttpInterceptor {
return this.sampleFetcher.getSampleThing(request.body.filter.arguments.value)
.pipe(map((sampleData: any) => {
return new HttpResponse({status: 200, body: {data: sampleData}});
}));
}), delay(1000)); // add delay for skeleton screens to be seen (see !16)
}
}
return this.sampleFetcher.getSampleThings().pipe(map((sampleData: any) => {
return new HttpResponse({status: 200, body: {data: sampleData}});
}));
}), delay(1000)); // add delay for skeleton screens to be seen (see !16)
}
}
return next.handle(request);