new AsyncLocalStorage([options])


版本历史
版本变更
v24.0.0

添加 defaultValuename 选项。

v19.7.0, v18.16.0

移除了实验性的 onPropagate 选项。

v19.2.0, v18.13.0

添加选项 onPropagate。

v13.10.0, v12.17.0

新增于: v13.10.0, v12.17.0

  • options <Object>

    • defaultValue <any> 未提供存储时使用的默认值。

      \defaultValue <any> The default value to be used when no store is provided.

    • name <string> AsyncLocalStorage 值的名称。

      \name <string> A name for the AsyncLocalStorage value.

创建 AsyncLocalStorage 的新实例。Store 仅在 run() 调用内或 enterWith() 调用后提供。

\Creates a new instance of AsyncLocalStorage. Store is only provided within a run() call or after an enterWith() call.

AltStyle によって変換されたページ (->オリジナル) /