codex-team/editor.js

API: improve block.insert() interface to allow passing parameters as an object instead of set

Open

#1,817 建立於 2021年11月24日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (1,985 fork)batch import
good first issue

倉庫指標

Star
 (26,602 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

  1. Describe a problem.

The current interface of the api.blocks.insert accepts parameters as a list:

this.api.blocks.insert(
      toolName,
      undefined,
      undefined,
      index,
      undefined,
      currentBlock.isEmpty
);    
  1. Describe the solution you'd like. Mockups are welcome.

It would better to pass parameters as an object:

this.api.blocks.insert({
  type: toolName,
  index,
  replace: currentBlock.isEmpty
});    

Important. We need to save the backward capability.

貢獻者指南