{"action":"created","issue":{"url":"https://api.github.com/repos/knockout/knockout/issues/1464","labels_url":"https://api.github.com/repos/knockout/knockout/issues/1464/labels{/name}","comments_url":"https://api.github.com/repos/knockout/knockout/issues/1464/comments","events_url":"https://api.github.com/repos/knockout/knockout/issues/1464/events","html_url":"https://github.com/knockout/knockout/issues/1464","id":38403580,"number":1464,"title":"Disposing of Knockout Extenders","user":{"login":"kmalakoff","id":756520,"avatar_url":"https://avatars.githubusercontent.com/u/756520?v=3","gravatar_id":"","url":"https://api.github.com/users/kmalakoff","html_url":"https://github.com/kmalakoff","followers_url":"https://api.github.com/users/kmalakoff/followers","following_url":"https://api.github.com/users/kmalakoff/following{/other_user}","gists_url":"https://api.github.com/users/kmalakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/kmalakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmalakoff/subscriptions","organizations_url":"https://api.github.com/users/kmalakoff/orgs","repos_url":"https://api.github.com/users/kmalakoff/repos","events_url":"https://api.github.com/users/kmalakoff/events{/privacy}","received_events_url":"https://api.github.com/users/kmalakoff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/knockout/knockout/labels/affected:%20few","name":"affected: few","color":"b0d8b0"},{"url":"https://api.github.com/repos/knockout/knockout/labels/proposed-sweep","name":"proposed-sweep","color":"fbca04"},{"url":"https://api.github.com/repos/knockout/knockout/labels/severity:%20minor","name":"severity: minor","color":"e17d81"},{"url":"https://api.github.com/repos/knockout/knockout/labels/type:%20feature","name":"type: feature","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-07-22T14:12:33Z","updated_at":"2015-04-09T17:15:15Z","closed_at":null,"body":"I received the following [issue](https://github.com/kmalakoff/knockback/issues/124) and started looking into extenders and memory management.\r\n\r\nIt looks like there are no hooks to dispose the composed observable. Would the following addition to Knockout be the correct solution?\r\n\r\n```\r\nfunction applyExtenders(requestedExtenders) {\r\n    var target = this;\r\n    if (requestedExtenders) {\r\n        ko.utils.objectForEach(requestedExtenders, function(key, value) {\r\n            var extenderHandler = ko.extenders[key];\r\n            if (typeof extenderHandler == 'function') {\r\n                target = extenderHandler(target, value) || target;\r\n            }\r\n        });\r\n    }\r\n\r\n    // release the extended observable\r\n    if (this !== target && this.dispose) {\r\n        var extended = this;\r\n        target.dispose = function() {\r\n            !target.dispose || target.dispose();\r\n            extended.dispose();\r\n        };\r\n    }\r\n\r\n    return target;\r\n}\r\n```\r\n\r\nIf not, how would you recommend correct memory management of extended observables?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/knockout/knockout/issues/comments/91296559","html_url":"https://github.com/knockout/knockout/issues/1464#issuecomment-91296559","issue_url":"https://api.github.com/repos/knockout/knockout/issues/1464","id":91296559,"user":{"login":"SteveSanderson","id":161375,"avatar_url":"https://avatars.githubusercontent.com/u/161375?v=3","gravatar_id":"","url":"https://api.github.com/users/SteveSanderson","html_url":"https://github.com/SteveSanderson","followers_url":"https://api.github.com/users/SteveSanderson/followers","following_url":"https://api.github.com/users/SteveSanderson/following{/other_user}","gists_url":"https://api.github.com/users/SteveSanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/SteveSanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SteveSanderson/subscriptions","organizations_url":"https://api.github.com/users/SteveSanderson/orgs","repos_url":"https://api.github.com/users/SteveSanderson/repos","events_url":"https://api.github.com/users/SteveSanderson/events{/privacy}","received_events_url":"https://api.github.com/users/SteveSanderson/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T17:15:15Z","updated_at":"2015-04-09T17:15:15Z","body":"To help us focus on more highly-prioritised issues, we're tidying up our issue backlog. We're closing the oldest feature requests that don't have pull requests and score very low on our [triage ranking system](http://triage.knockoutjs.com/). The low triage score for this feature request suggests we should focus our finite resources on other issues. For more details, [see here](https://github.com/knockout/knockout/issues/1754). Thanks for posting this feature request though. If you still actively want this feature, please reopen this issue, or post a new one (and ideally, be prepared to supply a pull request if we agree the feature would be accepted). Thanks!"}}