Skip to content

Commit 067f8ff

Browse files
Remove all listeners on initialization (#119)
* Remove all listeners on initialization * Bump to version 1.3.0 * Fix typo * Fix more typos on CHANGELOG --------- Co-authored-by: Pusher CI <pusher-ci@pusher.com>
1 parent ce2bc29 commit 067f8ff

File tree

3 files changed

+61
-55
lines changed

3 files changed

+61
-55
lines changed

CHANGELOG.md

+58-54
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,58 @@
1-
# Changelog
2-
3-
## 1.2.3
4-
5-
* [FIXED] Handle exceptions properly while subscribing to a channel on Android (#104)
6-
7-
8-
## 1.2.2
9-
10-
* [FIXED] Crash when a user subscribes to a channel twice on Android
11-
* [FIXED] Wait for unsubscription before deleting the local channel (#88)
12-
13-
## 1.2.1
14-
15-
* [FIXED] Fixed event name conflicts with other libs using RCTDeviceEventEmitter
16-
17-
## 1.2.0
18-
19-
* [CHANGED] Remove mutex locks in favor of storing callbacks so onAuthorizer does no longer freeze the app on iOS
20-
21-
## 1.1.1
22-
23-
* [CHANGED] Allow re-init of the Pusher singleton.
24-
* [CHANGED] Update dependencies
25-
26-
## 1.1.0
27-
28-
* [CHANGED] Add support for the new subscription_count event
29-
* [CHANGED] Using latest pusher-websocket-java and pusher-websocket-swift
30-
31-
## 1.0.2
32-
33-
* [CHANGED] Use latest pusher websocket java sdk.
34-
* [ADDED] Example to use a custom authorizer.
35-
36-
## 1.0.1
37-
38-
* [ADDED] Add onAuthorizer support to iOS
39-
40-
## 1.0.0
41-
42-
* [CHANGED] Removed unsupported functions from README
43-
* [FIXED] Fixed build error on Example app
44-
* [FIXED] Fixed CHANGELOG error on release workflow
45-
46-
## 1.0.0-beta1
47-
48-
* [FIXED] Fixed required dependencies on README
49-
* [ADDED] Add Lint support for Pull Requests
50-
* [CHANGED] Executed Lint on Example app
51-
52-
## 0.0.1-beta1
53-
54-
* [ADDED] First beta release 🥳
1+
# Changelog
2+
3+
## 1.3.0
4+
5+
* [ADDED] Add `reset` function to `Pusher` instance to reset all handlers and subscriptions (#110)
6+
* [FIXED] Multiple listeners are registered whenever `init function is called
7+
8+
## 1.2.3
9+
10+
* [FIXED] Handle exceptions properly while subscribing to a channel on Android (#104)
11+
12+
## 1.2.2
13+
14+
* [FIXED] Crash when a user subscribes to a channel twice on Android
15+
* [FIXED] Wait for unsubscription before deleting the local channel (#88)
16+
17+
## 1.2.1
18+
19+
* [FIXED] Fixed event name conflicts with other libs using RCTDeviceEventEmitter
20+
21+
## 1.2.0
22+
23+
* [CHANGED] Remove mutex locks in favor of storing callbacks so onAuthorizer does no longer freeze the app on iOS
24+
25+
## 1.1.1
26+
27+
* [CHANGED] Allow re-init of the Pusher singleton.
28+
* [CHANGED] Update dependencies
29+
30+
## 1.1.0
31+
32+
* [CHANGED] Add support for the new subscription_count event
33+
* [CHANGED] Using latest pusher-websocket-java and pusher-websocket-swift
34+
35+
## 1.0.2
36+
37+
* [CHANGED] Use latest pusher websocket java sdk.
38+
* [ADDED] Example to use a custom authorizer.
39+
40+
## 1.0.1
41+
42+
* [ADDED] Add onAuthorizer support to iOS
43+
44+
## 1.0.0
45+
46+
* [CHANGED] Removed unsupported functions from README
47+
* [FIXED] Fixed build error on Example app
48+
* [FIXED] Fixed CHANGELOG error on release workflow
49+
50+
## 1.0.0-beta1
51+
52+
* [FIXED] Fixed required dependencies on README
53+
* [ADDED] Add Lint support for Pull Requests
54+
* [CHANGED] Executed Lint on Example app
55+
56+
## 0.0.1-beta1
57+
58+
* [ADDED] First beta release 🥳

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pusher/pusher-websocket-react-native",
3-
"version": "1.2.3",
3+
"version": "1.3.0",
44
"description": "Pusher Channels Client for React Native",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

src/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ export class Pusher {
174174
onMemberAdded?: (channelName: string, member: PusherMember) => void;
175175
onMemberRemoved?: (channelName: string, member: PusherMember) => void;
176176
}) {
177+
this.removeAllListeners();
178+
177179
this.addListener(
178180
PusherEventName.ON_CONNECTION_STATE_CHANGE,
179181
(event: any) => {

0 commit comments

Comments
 (0)