Skip to content
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

Implement BridgeDelegate and BridgeComponent Protocol #6

Merged
merged 29 commits into from
Aug 7, 2023
Merged

Conversation

svara
Copy link
Collaborator

@svara svara commented Jul 31, 2023

This PR adds BridgeDelegate and defines the BridgeComponent protocol.

BridgeDelegate
The BridgeDelegate acts as the proxy between the bridge and the app's components.
It maintains a dictionary of initialized components and ensures that they are properly handled based on the received messages and lifecycle events.
It tracks the state of the destination's lifecycle and notifies the components about changes accordingly.
It provides methods to retrieve components by type and creates new components as needed.

BridgeComponent
The BridgeComponent protocol defines the base interface for components that can be registered with the bridge.
It requires the implementation of methods for handling messages and lifecycle events specific to each component.
It provides a default implementation for sending messages through the bridge.

Source/BridgeComponent.swift Outdated Show resolved Hide resolved
Source/BridgeDelegate.swift Outdated Show resolved Hide resolved
Source/BridgeDelegate.swift Outdated Show resolved Hide resolved
@svara svara changed the title Add BridgeDelegate and BridgeComponent Implement BridgeDelegate and BridgeComponent Protocol Aug 1, 2023
@svara svara requested a review from jayohms August 2, 2023 11:59
Source/BridgeDelegate.swift Outdated Show resolved Hide resolved
Source/BridgeDelegate.swift Outdated Show resolved Hide resolved
Source/BridgeDelegate.swift Outdated Show resolved Hide resolved
Copy link
Collaborator

@jayohms jayohms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, wonderful changes!

@svara svara merged commit e60faaa into main Aug 7, 2023
1 check passed
@jayohms jayohms deleted the bridge-delegate branch September 27, 2023 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants