CacheControl / CacheControl/json-rules-engine

Type of `Engine.on()` is wrong

未關閉
#295 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
3.1k
分支
507
PR 合併指標
30 天內沒有已合併 PR

描述

If you register an event handler on a specific event (i.e. `Engine.on("my-event", ...)`), the first argument of the method will be the `params` of the `Event` definition (type: `Record`), not the `Event` object itself.

I'm not sure if this only the case for specific events or more generally the `EventHandler`:
https://github.com/CacheControl/json-rules-engine/blob/90272d61ed7bea8b7d4000305511e932490d2e2e/types/index.d.ts#L106-L110

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start at types/index.d.ts around lines 106-110, linked from the issue, and compare the declared EventHandler type with the behavior of Engine.on("my-event", ...). Confirm what the callback receives for a specific event, then update the declaration so its first argument reflects the Event definition's params; add or adjust a type check if the repository provides one.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, typescript
領域
developer-experience
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。