"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "flow-client/src/main/resources/META-INF/resources/frontend/Connect.ts" between
vaadin-flow-4.0.5.tar.gz and vaadin-flow-4.0.6.tar.gz

About: Vaadin flow is a Java framework binding Vaadin web components to Java.

Connect.ts  (vaadin-flow-4.0.5):Connect.ts  (vaadin-flow-4.0.6)
skipping to change at line 339 skipping to change at line 339
await assertResponseIsOk(response); await assertResponseIsOk(response);
return response.json(); return response.json();
}; };
// The actual fetch call itself is expressed as a middleware // The actual fetch call itself is expressed as a middleware
// chain item for our convenience. Always having an ending of the chain // chain item for our convenience. Always having an ending of the chain
// this way makes the folding down below more concise. // this way makes the folding down below more concise.
const fetchNext: MiddlewareNext = const fetchNext: MiddlewareNext =
async(context: MiddlewareContext): Promise<Response> => { async(context: MiddlewareContext): Promise<Response> => {
this.loading(true); this.loading(true);
return fetch(context.request).then(response => { try {
return fetch(context.request);
} finally {
this.loading(false); this.loading(false);
return response; }
});
}; };
// Assemble the final middlewares array from internal // Assemble the final middlewares array from internal
// and external middlewares // and external middlewares
const middlewares = [responseHandlerMiddleware].concat(this.middlewares); const middlewares = [responseHandlerMiddleware].concat(this.middlewares);
// Fold the final middlewares array into a single function // Fold the final middlewares array into a single function
const chain = middlewares.reduceRight( const chain = middlewares.reduceRight(
(next: MiddlewareNext, middleware: Middleware) => { (next: MiddlewareNext, middleware: Middleware) => {
// Compose and return the new chain step, that takes the context and // Compose and return the new chain step, that takes the context and
 End of changes. 2 change blocks. 
3 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)