前端开发中的“乐观更新”是什么? [英] what is `optimistic updates` in front-end development

查看:1055
本文介绍了前端开发中的“乐观更新”是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读介绍 redux

code> pattern ,并且有以下段落:


...考虑新要求变得常见在前端产品
开发中,例如处理乐观更新,在
服务器上渲染,在执行路由转换之前获取数据等。


我的问题是什么乐观更新在这里?

解决方案

在乐观更新中,用户界面的行为就像在从服务器收到实际确认之前成功完成更改一样 - 它乐观地认为它最终会得到确认而不是错误。这可以提供更快速的用户体验。

I'm reading the intro to redux pattern, and there is the following paragraph there:

... consider the new requirements becoming common in front-end product development, such as handling optimistic updates, rendering on the server, fetching data before performing route transitions, and so on.

My question is what is optimistic updates here?

解决方案

In an optimistic update the UI behaves as though a change was successfully completed before receiving confirmation from the server that it actually was - it is being optimistic that it will eventually get the confirmation rather than an error. This allows for a more responsive user experience.

这篇关于前端开发中的“乐观更新”是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆