{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/22","repository_url":"https://api.github.com/repos/tc39/proposal-collection-methods","labels_url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/22/comments","events_url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/22/events","html_url":"https://github.com/tc39/proposal-collection-methods/issues/22","id":379281424,"node_id":"MDU6SXNzdWUzNzkyODE0MjQ=","number":22,"title":"Addition for freezing collections","user":{"login":"bradennapier","id":15365418,"node_id":"MDQ6VXNlcjE1MzY1NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/15365418?v=4","gravatar_id":"","url":"https://api.github.com/users/bradennapier","html_url":"https://github.com/bradennapier","followers_url":"https://api.github.com/users/bradennapier/followers","following_url":"https://api.github.com/users/bradennapier/following{/other_user}","gists_url":"https://api.github.com/users/bradennapier/gists{/gist_id}","starred_url":"https://api.github.com/users/bradennapier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradennapier/subscriptions","organizations_url":"https://api.github.com/users/bradennapier/orgs","repos_url":"https://api.github.com/users/bradennapier/repos","events_url":"https://api.github.com/users/bradennapier/events{/privacy}","received_events_url":"https://api.github.com/users/bradennapier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2018-11-09T18:55:34Z","updated_at":"2018-12-05T03:33:08Z","closed_at":null,"author_association":"NONE","body":"As mentioned in https://github.com/tc39/proposal-set-methods/issues/30 it would be nice to have a way of \"freezing\" (or some other name if \"freeze\" doesn't match perfectly) collections seems ideal."},"comment":{"url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/comments/444346506","html_url":"https://github.com/tc39/proposal-collection-methods/issues/22#issuecomment-444346506","issue_url":"https://api.github.com/repos/tc39/proposal-collection-methods/issues/22","id":444346506,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDM0NjUwNg==","user":{"login":"bradennapier","id":15365418,"node_id":"MDQ6VXNlcjE1MzY1NDE4","avatar_url":"https://avatars3.githubusercontent.com/u/15365418?v=4","gravatar_id":"","url":"https://api.github.com/users/bradennapier","html_url":"https://github.com/bradennapier","followers_url":"https://api.github.com/users/bradennapier/followers","following_url":"https://api.github.com/users/bradennapier/following{/other_user}","gists_url":"https://api.github.com/users/bradennapier/gists{/gist_id}","starred_url":"https://api.github.com/users/bradennapier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradennapier/subscriptions","organizations_url":"https://api.github.com/users/bradennapier/orgs","repos_url":"https://api.github.com/users/bradennapier/repos","events_url":"https://api.github.com/users/bradennapier/events{/privacy}","received_events_url":"https://api.github.com/users/bradennapier/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T03:33:08Z","updated_at":"2018-12-05T03:33:08Z","author_association":"NONE","body":"@erights yes i was indicating that in the case of a lockable map vs the previously mentioned readOnly view which can still be mutated using the original collection it can cause the issue.\r\n\r\naka:\r\n\r\n```\r\n// lib file\r\nconst set = new Set();\r\nexport function getSet() { return set.readonly };\r\n\r\nexport function doSomething() { set.add(value) };\r\n```\r\n\r\nnow since set is mutable but the user has a read only view - they may think it safer to do something like\r\n\r\n```\r\n// user file\r\nimport { getSet, doSomething } from 'lib';\r\n\r\ngetSet().forEach(value => { doSomething() });\r\n```\r\n\r\nwhich would cause a confusing issue due to the disconnect between a library author and a consumer.  Obviously its about knowing not to loop collections you dont control in such a manner - but its a detail that I personally think will be lost on many and a potential pain point since its not behavior seen in standard objects.\r\n"}}
{"actor":{"display_login":"bradennapier"}}