{"action":"closed","issue":{"url":"https://api.github.com/repos/polygonal/ds/issues/35","repository_url":"https://api.github.com/repos/polygonal/ds","labels_url":"https://api.github.com/repos/polygonal/ds/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/polygonal/ds/issues/35/comments","events_url":"https://api.github.com/repos/polygonal/ds/issues/35/events","html_url":"https://github.com/polygonal/ds/issues/35","id":150754520,"number":35,"title":"Graph/Graphnode","user":{"login":"vantreeseba","id":316782,"avatar_url":"https://avatars.githubusercontent.com/u/316782?v=3","gravatar_id":"","url":"https://api.github.com/users/vantreeseba","html_url":"https://github.com/vantreeseba","followers_url":"https://api.github.com/users/vantreeseba/followers","following_url":"https://api.github.com/users/vantreeseba/following{/other_user}","gists_url":"https://api.github.com/users/vantreeseba/gists{/gist_id}","starred_url":"https://api.github.com/users/vantreeseba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vantreeseba/subscriptions","organizations_url":"https://api.github.com/users/vantreeseba/orgs","repos_url":"https://api.github.com/users/vantreeseba/repos","events_url":"https://api.github.com/users/vantreeseba/events{/privacy}","received_events_url":"https://api.github.com/users/vantreeseba/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-25T05:37:59Z","updated_at":"2016-10-18T15:15:14Z","closed_at":"2016-10-18T15:15:14Z","body":"When creating a graphnode, you have to supply a graph to it, but it does nothing but keep it internally.\r\n\r\nWould this be better to do when adding it to the graph itself, or should it add itself to the graph at construction?\r\n\r\nCurrently the code looks like\r\n```haxe\r\nvar graph = new Graph<MyData>();\r\nvar myData = new MyData();\r\nvar node = new GraphNode<MyData>(graph, myData);\r\ngraph.add(node);\r\n```\r\n\r\nI'm imagining it would be easier to understand if it was something like\r\n```haxe\r\nvar graph  = new Graph<MyData>();\r\nvar myData = new MyData();\r\nvar node = new GraphNode<MyData>(myData);\r\ngraph.add(node); //this would set the graph var on the node.\r\n```\r\n\r\nor \r\n\r\n```haxe\r\nvar graph  = new Graph<MyData>();\r\nvar myData = new MyData();\r\nvar node = new GraphNode<MyData>(graph, myData);  //this would call graph.add.\r\n```\r\n\r\nThe way its currently implemented doesn't seem clear, and I don't see what benefit it has.  I'll make a branch and PR if this sounds good."}}
{"actor":{"display_login":"polygonal"}}