New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: BREAKING Overhauls to the pub/sub system #39
Conversation
* Breaks out a separate PortalsPubSub class from PortalsPlugin to separate the event bus logic from the implementation of the Plugin * Makes PortalsPlugin useable as an instance plugin to scope events to a specific instance of PortalsPubSub * Adds the ability to scope the pubSub instance in `linkMessageReceivers` on PortalFragment.
This PR is much in the same spirit of ionic-team/ionic-portals-ios#71, without the changes in how subscriptions are managed. |
fun unsubscribe(topic: String, subscriptionRef: Int) { | ||
subscriptions[topic]?.remove(subscriptionRef) | ||
} | ||
val shared = PortalsPubSub() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really know if this is a very common convention in Android/Kotlin/JVM stuff when providing a base singleton to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so
`linkMessageReceivers` has been called
@carlpoole and I also discussed adding |
Added @IT-MikeS to review as I'm not comfortable commenting on the TS singleton comment |
Did I miss something? There's no TS being worked on here it would seem @giralte-ionic |
The comment was regarding Kotlin and Java patterns |
ok sorry I'm dumb |
Breaks out a separate PortalsPubSub class from PortalsPlugin to separate the event bus logic from the implementation of the Plugin
Makes PortalsPlugin useable as an instance plugin to scope events to a specific instance of PortalsPubSub
Adds the ability to scope the pubSub instance in
linkMessageReceivers
on PortalFragment.