You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice is that a lot of the syncing methods now have a nilable parameter, that seems to be nil in the majority of cases. Perhaps we could simplify the method logic and update Messenger's state with a "RawMessageHandler" register.
The consuming code would look like something below:
m.SetRawMessageHandler(rawMessageHandler)
m.SyncDevices()
m.SendPairInstallation(context.TODO)
m.ResetRawMessageHandler() // Defaults back to `dispatchPairInstallationMessage()`
Implementing this change would simplify the calling of all the functions that have an optional RawMessageHandler , future developers don't need to know what a RawMessageHandler is unless they want to change "broadcasting" behaviour.
Additionally we have precedent for altering Messenger behaviour via an update to state with the use of the localPairing field, this is used as below:
Consider the relationship between these two factors, localPairing and RawMessageHandler. Is there a link between them that would affect the implementation?
Perhaps if localPairing is true, a non-default RawMessageHandler should be present?
I notice is that a lot of the syncing methods now have a nilable parameter, that seems to be nil in the majority of cases. Perhaps we could simplify the method logic and update
Messenger
's state with a "RawMessageHandler" register.The consuming code would look like something below:
Implementing this change would simplify the calling of all the functions that have an optional
RawMessageHandler
, future developers don't need to know what aRawMessageHandler
is unless they want to change "broadcasting" behaviour.Additionally we have precedent for altering
Messenger
behaviour via an update to state with the use of thelocalPairing
field, this is used as below:Consider the relationship between these two factors,
localPairing
andRawMessageHandler
. Is there a link between them that would affect the implementation?Perhaps if
localPairing
is true, a non-defaultRawMessageHandler
should be present?Details
#3202 (comment)
The text was updated successfully, but these errors were encountered: