# @effector/redux-devtools-adapter 中文文档

规范地址：https://npmcn.com/package/%40effector/redux-devtools-adapter/

版本：0\.2\.0
npm 元数据更新时间：2026-01-13T08:02:36.951Z
中文译文更新时间：2026-11-13T09:19:07.215Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40effector/redux-devtools-adapter
原文对照：https://npmcn.com/package/%40effector/redux-devtools-adapter/?lang=original
项目主页：https://github.com/effector/redux-devtools-adapter#readme
源码仓库：https://github.com/effector/redux-devtools-adapter

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：16.8 kB，6 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- peer 依赖：effector ^22\.8\.1 \|\| ^23\.0\.0
- 首次发布：2023-04-28T07:37:25.486Z
- 最新版本发布：2023-12-02T13:15:28.879Z
- 近 30 天下载量：6930（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：8（近 12 个月 0 个）

## 中文简介

将 Effector 的检查 API 连接到 Redux DevTools 的简单适配器

## 安装

```sh
npm install @effector/redux-devtools-adapter
```

也可以使用：`pnpm add @effector/redux-devtools-adapter`、`yarn add @effector/redux-devtools-adapter`、`bun add @effector/redux-devtools-adapter`

## README

# 复写工具调整器

将 Effector 的 API 连接到 Redux DevTools 的简单适配器, 从旧程序提取 `effector-logger` 项目.

![image](https://user-images.githubusercontent.com/32790736/235296652-b74df685-c436-45c1-911e-7a6e99e78770.png)

## 安装

```sh
yarn add -D @effector/redux-devtools-adapter
```

## 使用量

### 准备元数据

为了使日志更加有用,我们需要更多的元数据(如名称、代码中的位置等),由其中之一提供 `effector` 插件 .

#### 贝贝-插剂

Babel-Plugin是内置的在其中 `effector` 软件包.

只要把它加入你的贝贝配置.

```json
{
  "plugins": ["effector/babel-plugin"]
}
```

使 `loc` 生成用于 dev 环境,以查看 `sample`s和代码中的其他运算符.

```json
{
  "plugins": [["effector/babel-plugin", { "addLoc": true }]]
}
```

[读取文件](https://effector.dev/docs/api/effector/babel-plugin/#usage)

#### SWC 插件

[读取效果器 SWC 插件文档](https://github.com/effector/swc-plugin)

### 在代码中

打电话 `attachReduxDevTools()` 在你的项目入口处 你可以走了.

```ts
// e.g. src/main.ts
import { attachReduxDevTools } from "@effector/redux-devtools-adapter";

attachReduxDevTools();
```

也可以提供一些额外的配置. 所有字段都是可选的.

#### 名称

类型 : `string`。 。 。 . 将在 Redux Devtools 中可见

#### 范围

类型 : `Scope` 如果您的应用程序使用它, 请使用 Fork API 的 Effector 范围 .

见 [文档](https://effector.dev/docs/api/effector/scope/) 财务报告和审定财务报表 [条款](https://dev.to/effector/the-best-part-of-effector-4c27)

#### 追踪

类型 : `boolean` 启用效果器在动作中的计算痕迹 。 默认禁用 .

#### 批次

类型 : `boolean | { size: number; latency: number; }`。 。 。 . 允许在适配器一侧对日志进行分批。 Redux DevTools正在尝试打印他们得到的每一个日志,这可能会在大型应用程序中引起性能问题.

已启用的批量适配器只发送一次日志 `latency` 毫秒和日志数不超过 `size` 编号. 这意味着只有最后 `size` devTools 中将始终显示日志数.

默认启用后, defautls为:最后100个有平缓500毫秒的日志.

### 状态标签

类型 : `boolean`。 。 。 . 启用状态标签, 并注明每个时间点的所有存储状态 。 可能在大型app中引起性能问题. 默认禁用 .

#### devTools 配置

Redux DevTools 的配置, 直接传递给 `connect` 电话. 见 [官方文件](https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md)。 。 。 .

组合调用示例:

```ts
import { attachReduxDevTools } from "@effector/redux-devtools-adapter";

attachReduxDevTools({
  name: "My App",
  scope,
  trace: true,
});
```

### 在下一条.js - 页面路由器

[读取效果/下一个文档](https://github.com/effector/next#pages-router-dev-tools-example)

### 在下一个.js - App路由器

[读取效果/下一个文档](https://github.com/effector/next#app-router-dev-tools-example)

## 释放过程

1.  看看这个 [释放草稿](https://github.com/effector/redux-devtools-adapter/releases)。 。 。 .
2.  所有公关应当有正确的标签和有用的标题. 你们可以 [在此审查可用的标签](https://github.com/effector/redux-devtools-adapter/blob/main/.github/release-drafter.yml)。 。 。 .
3.  更新 PR 和标题的标签, 下次 [手动运行发行起草器动作](https://github.com/effector/redux-devtools-adapter/actions/workflows/release-drafter.yml) 重新生成释放草稿.
4.  审查新版本并按"Publish"
5.  如果需要检查“ 此发行的创意讨论”

## 常见问题

### @effector/redux-devtools-adapter 是什么？

将 Effector 的检查 API 连接到 Redux DevTools 的简单适配器

### 如何安装 @effector/redux-devtools-adapter？

在项目目录运行 npm install @effector/redux-devtools-adapter，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：effector（^22\.8\.1 \|\| ^23\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @effector/redux-devtools-adapter 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @effector/redux-devtools-adapter 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @effector/redux-devtools-adapter 可以商用吗？

@effector/redux-devtools-adapter 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @effector/redux-devtools-adapter 的下载量有多少？

根据 npm 官方下载统计，@effector/redux-devtools-adapter 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,930 次，日均约 231 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @effector/redux-devtools-adapter 还在维护吗？

最新版本 0\.2\.0 发布于 2023/12/02（2 年前）；至今共发布 8 个版本，其中过去 12 个月发布了 0 个；首次发布于 2023/04/28。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

