-
Notifications
You must be signed in to change notification settings - Fork 12
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
Should Accessibility.js be able to update peers directly? #773
Comments
I'm not too concerned, since this is scenery-internal. It looks like shared behavior that factors code out, basically taking the two steps Node => AccessibleInstance and AccessibleInstance => AccessiblePeer into one step. |
@zepumph here is one idea for an alternative. Accessibility.updateAccessibleInstances: function( callback ) {
for ( var i = 0; i < this._accessibleInstances.length; i++ ) {
this._accessibleInstances[ i ].updatePeer( callback );
}
}, AccessibleInstance.updateAccessiblePeer: function( callback ) {
this.peer.updatePeer( callback );
}, Could also consider something different like specific functions for each callback passed to |
Does this seem like the right way to go? Is it even worth it? I see 14 usages of I'm happy to implement this if you think it is worth it. I don't think it would be too hard. |
As part of #814 we are doing a lot of work related to this. Right now we are going to tell the peer to update directly from the Node, but the Peer is actually going to do the updating, so things are more modular. Closing |
At a high level, I have always thought that there was modularity in function between AccessibleInstance and AccessiblePeer, such that
Node ---> AccessibleInstance ---> AccessiblePeer
So a node can have
n
AccessibleInstance
s and eachAccessibleInstance
has 1AccessiblePeer
. From this thought process, I would expect that AccessiblePeer can only be accessed from the instance, for modularity's sake.In
Accessibility.js
I seeupdateAccessiblePeers
which directly through instances updates the accessiblePeers. To me this seems like it breaks the modularity.I would expect that Node (
Accessibility.js
) would only interact with itsAccessibleInstances
, I think it may be nicer if AccessibleInstance it the only thing that updates it accessible peer. @jessegreenberg what do you think? Tagging @jonathanolson for comment too. I can't think of any specific reason why it is a large benefit, but I do feel like the current implementation is a code smell.The text was updated successfully, but these errors were encountered: