v1.2.0
What's Changed
- chore: update workspace dependencies by @Tomass673 in #39
- feat: pusher websocket service enhancements by @ipakhomov in #40
- feat: add pusher websockets RN hook and update readme by @ipakhomov in #41
- feat: setup CI by @ipakhomov in #42
- chore: reconfigure package builds by @ipakhomov in #43
Pusher websockets utilities change
WebSocketServicenow requires callinginit()beforeconnect()as per Pusher docs.
Theinit()method now can accept:
- a token getter function for dynamic token retrieval, ensuring the latest authentication token is always used;
- set of handlers to pass callbacks into pusher client instance
Migration:
// Before
await webSocketService.connect('your-auth-token');
// After
const tokenGetter = () => getAuthToken(); // Function that returns current token
await webSocketService.init(tokenGetter, {
// Optional handlers
onConnectionStateChange: (currentState) => {
// Do something with the connection state
},
}
);
webSocketService.connect();- Added new hook
usePusherReactNativethat automatically manages WebSocket connection lifecycle for React Native apps.
Full Changelog: v1.1.0...v1.2.0