UNPKG

@thepassle/app-tools

Version:

Collection of tools I regularly use to build apps. Maybe they're useful to somebody else. Maybe not. Most of these are thin wrappers around native API's, like the native `<dialog>` element, `fetch` API, and `URLPattern`.

24 lines (23 loc) 737 B
export function createService(defaults: any): { new (host: any, promise: any): { host: any; promise: any; state: string; setPromise(promise: any): void; setError(msg: any): void; errorMessage: any; request(params: any): any; data: any; /** * Use states individually, useful if you may need to render stuff in different locations */ initialized(templateFn: any): any; pending(templateFn: any): any; success(templateFn: any): any; error(templateFn: any): any; /** * Combined render method, if you want to just render everything in place */ render(templates: any): any; }; };