Skip to content

Commit

Permalink
Merge pull request #28 from SuperViz/fix/realtime
Browse files Browse the repository at this point in the history
Fix realtime publish
  • Loading branch information
aquino-mael authored Oct 29, 2024
2 parents bc040bb + d6dcdc5 commit 5011daa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/realtime.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Realtime - Configure and publish package

on:
push:
tags:
- "superviz-realtime-[0-9]+.[0-9]+.[0-9]+**"
branches: ["master"]
paths:
- "packages/realtime/**"
Expand Down
21 changes: 0 additions & 21 deletions packages/realtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
## [1.0.2](https://github.com/SuperViz/realtime-flutter/compare/superviz-realtime-1.0.1...superviz-realtime-1.0.2) (2024-10-29)


### Bug Fixes

* remove initial changelog register ([8b0969e](https://github.com/SuperViz/realtime-flutter/commit/8b0969e1b2207972e8e7234ac8ac7acf1e98a75a))

## [1.0.2](https://github.com/SuperViz/realtime-flutter/compare/superviz-realtime-1.0.1...superviz-realtime-1.0.2) (2024-10-29)


### Bug Fixes

* remove initial changelog register ([8b0969e](https://github.com/SuperViz/realtime-flutter/commit/8b0969e1b2207972e8e7234ac8ac7acf1e98a75a))

## [1.0.1](https://github.com/SuperViz/realtime-flutter/compare/superviz-realtime-1.0.0...superviz-realtime-1.0.1) (2024-10-29)


### Bug Fixes

* incorrect package name on install dependency ([2ae5978](https://github.com/SuperViz/realtime-flutter/commit/2ae59780c0fd52cc511bbd6c31f568ceabb9d327))

# 1.0.0 (2024-10-29)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ final class Realtime extends Observable {

_state = state;

publish(
publish<Map<String, RealtimeComponentState>>(
RealtimeComponentEvent.realtimeStateChanged.description,
{'state': _state},
);
Expand Down
2 changes: 1 addition & 1 deletion packages/realtime/lib/src/services/channel/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class Channel extends Observable {
/// - `event` - The name of the event to publish.
/// - `data` - Data to be sent along with the event.
@override
void publish(String event, [Map<String, dynamic>? data]) {
void publish<T>(String event, [T? data]) {
if (_state != RealtimeChannelState.connected) {
final message =
'Realtime channel $_name has not started yet. You can\'t publish event $event before start';
Expand Down
2 changes: 1 addition & 1 deletion packages/realtime/lib/src/utils/observable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ abstract class Observable {
/// Publish an event to client
/// - `type` - Event type.
/// - `data` - Event data.
void publish(String type, [Map<String, dynamic>? data]) {
void publish<T>(String type, [T? data]) {
final hasListenerRegistered = _observers.keys.any((key) => key == type);

if (!hasListenerRegistered) return;
Expand Down

0 comments on commit 5011daa

Please sign in to comment.