Closed bisgardo closed 1 year ago
I'm not sure I understand the purpose/reason for this change? :thinking:
I'm not sure I understand the purpose/reason for this change? thinking
Are you asking me whether you understand the reason? :stuck_out_tongue: On a serious note, I updated the stated purpose; is it clearer now?
Purpose
Remove the responsibility of initiating connections from
WithWalletConnector
. This simplifies this component and takes away any confusion as to why there's more than one way to establish a connection (and what exactly each method does and doesn't).The field
activeConnection
will be moved from from this component into a hook in the followup PR #20. This will leaveWithWalletConnector
as a much simpler component with a single clear responsibility.Changes
Instead of using the
connectActive
method, one should just callconnect
directly on the connector which will then notifyWithWalletConnector
via its role as the connector's delegate. The application then callssetActiveConnection
to set it as active if desired.This means that
activeConnectorError
no longer holds errors for connections (only the connector's error as the name also implies) and that theisConnecting
indicator no longer is maintained: It's now the application's job to track this state.