import { HttpResponse } from './response' ; import { fetchStack , restore , mockFetch } from './mock' ; export class Backend { constructor ( ) { fetchStack . clear ( ) ; mockFetch ( ) ; } whenGET ( uri , query ? ) { return new HttpResponse ( uri , 'get' , query ) ; } whenPUT ( uri , data ? ) { return new HttpResponse ( uri , 'put' , data ) ; } whenPOST ( uri , data ? ) { return new HttpResponse ( uri , 'post' , data ) ; } whenDELETE ( uri ) { return new HttpResponse ( uri , 'delete' ) ; } restore ( ) { restore ( ) ; } }