React Hooks的体系设计之一 - 分层

  • 最底层的内置hook,不需要自己实现,官方直接提供
  • 简化状态更新方式的hook,比较经典的是引入immer来达到更方便地进行不可变更新的目的
  • 引入“状态 + 行为”的概念,通过声明状态结构与相应行为快速创建一个完整上下文
  • 对常见数据结构的操作进行封装,如数组的操作
  • 针对通用业务场景进行封装,如分页的列表、滚动加载的列表、多选等
  • 实际面向业务的实现

SameSite cookies explained

The site is the combination of the domain suffix and the part of the domain just before it. For example, the www.web.dev domain is part of the web.dev site.

The public suffix list defines this, so it’s not just top-level domains like .com but also includes services like github.io. That enables your-project.github.io and my-project.github.io to count as separate sites.

site 就是 suffix 前面那一部分:www.web.dev 就是 webyour-project.github.io就是 your-project

所以:

  • If the user is on www.web.dev and requests an image from static.web.dev then that is a same-site request.
  • If the user is on your-project.github.io and requests an image from my-project.github.io that’s a cross-site request.

怎么读 ECMAScript 规范

  • https://v8.dev/blog/understanding-ecmascript-part-1
  • https://timothygu.me/es-howto/

具体规范中语法的表达是容易看懂的,但是规范会自定义些标识符或者操作符,这个是需要理解的。

以上。