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

Subgraphs always send defaults. #243

Closed
ever-null opened this issue Jul 30, 2014 · 0 comments
Closed

Subgraphs always send defaults. #243

ever-null opened this issue Jul 30, 2014 · 0 comments

Comments

@ever-null
Copy link
Contributor

When a graph is used as a subgraph through components/Graph.coffee the defaults are always sent regardless of whether the parent graph has an attached socket. This may require checking socket count in the Network.sendDefaults method on the socket.to property.

Something like:

    for socket in @defaults
      continue unless socket.to.sockets.length is 1
      socket.connect()
      socket.send()
      socket.disconnect()

Or maybe a more specific socket check:

    for socket in @defaults
      continue unless socket.to.sockets.length is 1 and deepEquals(socket, socket.to.sockets[0])
      socket.connect()
      socket.send()
      socket.disconnect()

This may not be the optimal way to handle it. Other options would be to investigate whether defaults should be removed as a socket is attached to a subgraph or refreshing a network's defaults from the parent.

** The coffee syntax might not be correct, just throwing the ideas out here for now.

@bergie bergie closed this as completed in 06ae593 Aug 4, 2014
bergie added a commit that referenced this issue Aug 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant