mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
[CSTPER-66] utility functions to create remote data object without content
This commit is contained in:
@@ -69,3 +69,24 @@ export function createPendingRemoteDataObject<T>(object?: T): RemoteData<T> {
|
||||
export function createPendingRemoteDataObject$<T>(object?: T): Observable<RemoteData<T>> {
|
||||
return observableOf(createPendingRemoteDataObject(object));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create a remote data object with no content
|
||||
*/
|
||||
export function createNoContentRemoteDataObject<T>(): RemoteData<T> {
|
||||
return new RemoteData(
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
null,
|
||||
null,
|
||||
204
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to create a remote data object that has succeeded with no content, wrapped in an observable
|
||||
*/
|
||||
export function createNoContentRemoteDataObject$<T>(): Observable<RemoteData<T>> {
|
||||
return observableOf(createNoContentRemoteDataObject());
|
||||
}
|
||||
|
Reference in New Issue
Block a user