Skip to content

Commit

Permalink
release(preload): v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alex8088 committed Jun 4, 2023
1 parent 36683dd commit 0714807
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions packages/preload/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
### v2.0.0 (_2023-06-04_)

New way to remove a listener

```ts
const listener = (_, ...args): void => {}
const ipc = window.electron.ipcRenderer

// Old, remove listener not work
ipc.on(channel, listener)
ipc.removeListener(channel, listener)

// New
const removeListener = ipc.on(channel, listener)
removeListener()
```

- refactor: remove IpcRendererEvent type export and use Electron's own type
- refactor: remove listener
- refactor: deprecated IpcRenderer removeListener API
- chore: export IpcRendererListener type

### v1.0.3 (_2022-12-28_)

#### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/preload/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@electron-toolkit/preload",
"version": "1.0.3",
"version": "2.0.0",
"description": "Toolkit for electron preload scripts.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 0714807

Please sign in to comment.