{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/axon/issues/93","repository_url":"https://api.github.com/repos/phetsims/axon","labels_url":"https://api.github.com/repos/phetsims/axon/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/axon/issues/93/comments","events_url":"https://api.github.com/repos/phetsims/axon/issues/93/events","html_url":"https://github.com/phetsims/axon/issues/93","id":148441766,"number":93,"title":"Investigate pattern for automatically wiring up dispose","user":{"login":"samreid","id":679486,"avatar_url":"https://avatars.githubusercontent.com/u/679486?v=3","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phetsims/axon/labels/priority:2-high","name":"priority:2-high","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"samreid","id":679486,"avatar_url":"https://avatars.githubusercontent.com/u/679486?v=3","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2016-04-14T18:15:26Z","updated_at":"2016-04-14T22:42:05Z","closed_at":null,"body":"Currently link/unlink, addListener/removeListener, addTandem/removeTandem are spread out, with all the add's together and all the removes together.  Today we discussed an idea to couple each link/unlink add/remove etc instead of scattering them.  It could be mediated through a disposeEmitter.\r\n\r\nFrom 4/14/16 dev meeting notes:\r\n\r\n* @pixelzoom will commit DisposeExampleNode to phet-info\r\n* @samreid will tinker with a pattern for specifying link + unlink in 1 call, probably based on disposeEmitter\r\n* @andrewadare will hold off on further dispose implementation\r\n* The current pattern will persist for a while, since we have a lot of it."},"comment":{"url":"https://api.github.com/repos/phetsims/axon/issues/comments/210190565","html_url":"https://github.com/phetsims/axon/issues/93#issuecomment-210190565","issue_url":"https://api.github.com/repos/phetsims/axon/issues/93","id":210190565,"user":{"login":"andrewadare","id":154163,"avatar_url":"https://avatars.githubusercontent.com/u/154163?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewadare","html_url":"https://github.com/andrewadare","followers_url":"https://api.github.com/users/andrewadare/followers","following_url":"https://api.github.com/users/andrewadare/following{/other_user}","gists_url":"https://api.github.com/users/andrewadare/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewadare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewadare/subscriptions","organizations_url":"https://api.github.com/users/andrewadare/orgs","repos_url":"https://api.github.com/users/andrewadare/repos","events_url":"https://api.github.com/users/andrewadare/events{/privacy}","received_events_url":"https://api.github.com/users/andrewadare/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T22:42:05Z","updated_at":"2016-04-14T22:42:05Z","body":"I am inclined to prefer the `link(observer,options)` approach to `linkWithDispose` because the `*withDispose` syntax, while short to type, is less clear than it could be (so I guess I disagree with SR about it being more readable). \r\n\r\nFor example, the [.withDisposal](https://github.com/phetsims/phet-info/blob/38ba1fe81f4ac789c18894f2974dcf1b632596bc/js/DisposeExampleNode.js#L52-L55) functions don't make it very apparent (to me) what they actually do. In my simple-minded thinking, a function is usually something verb-like, unless it's a constructor.\r\n\r\n I also don't like the potential confusion that `linkWithSomething` sounds like the function is linking with (i.e. to) something.\r\n\r\nMaybe this is just a solvable naming issue that causes my hangup, I'm not sure yet. In an ideal world, there would be some way that Axon could track the property/emitter/event without the necessity for doing it in user code. But I have no idea how that could be implemented.\r\n"}}