{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/3308","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/3308/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/3308/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/3308/events","html_url":"https://github.com/facebook/flow/pull/3308","id":204313511,"number":3308,"title":"Add $Frozen<T> utility type to describe frozen objects","user":{"login":"jonbretman","id":1671025,"avatar_url":"https://avatars.githubusercontent.com/u/1671025?v=3","gravatar_id":"","url":"https://api.github.com/users/jonbretman","html_url":"https://github.com/jonbretman","followers_url":"https://api.github.com/users/jonbretman/followers","following_url":"https://api.github.com/users/jonbretman/following{/other_user}","gists_url":"https://api.github.com/users/jonbretman/gists{/gist_id}","starred_url":"https://api.github.com/users/jonbretman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonbretman/subscriptions","organizations_url":"https://api.github.com/users/jonbretman/orgs","repos_url":"https://api.github.com/users/jonbretman/repos","events_url":"https://api.github.com/users/jonbretman/events{/privacy}","received_events_url":"https://api.github.com/users/jonbretman/received_events","type":"User","site_admin":false},"labels":[{"id":196859323,"url":"https://api.github.com/repos/facebook/flow/labels/CLA%20Signed","name":"CLA Signed","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-01-31T14:28:07Z","updated_at":"2017-02-14T01:31:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/flow/pulls/3308","html_url":"https://github.com/facebook/flow/pull/3308","diff_url":"https://github.com/facebook/flow/pull/3308.diff","patch_url":"https://github.com/facebook/flow/pull/3308.patch"},"body":"This is in reference to https://github.com/facebook/flow/issues/739 and https://github.com/facebook/flow/issues/18 and adds the utility type `$Frozen<T>` which can be used to indicate that a type is (or should be considered) frozen.\r\n\r\nFor example if you define a type like so:\r\n\r\n```js\r\ntype Person = $Frozen<{\r\n    name: string\r\n}>\r\n```\r\n\r\nAll objects of type `Person` will now be considered frozen.\r\n\r\n```js\r\nconst person: Person  = {name: 'Sally'};\r\nperson.name = 'Helen'; // error\r\n```\r\n\r\nFull Disclosure: I am no OCaml expert and won't pretend I fully understand the implications of this change so am looking for feedback / reviews."},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/279579703","html_url":"https://github.com/facebook/flow/pull/3308#issuecomment-279579703","issue_url":"https://api.github.com/repos/facebook/flow/issues/3308","id":279579703,"user":{"login":"cloudkite","id":598870,"avatar_url":"https://avatars.githubusercontent.com/u/598870?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudkite","html_url":"https://github.com/cloudkite","followers_url":"https://api.github.com/users/cloudkite/followers","following_url":"https://api.github.com/users/cloudkite/following{/other_user}","gists_url":"https://api.github.com/users/cloudkite/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudkite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudkite/subscriptions","organizations_url":"https://api.github.com/users/cloudkite/orgs","repos_url":"https://api.github.com/users/cloudkite/repos","events_url":"https://api.github.com/users/cloudkite/events{/privacy}","received_events_url":"https://api.github.com/users/cloudkite/received_events","type":"User","site_admin":false},"created_at":"2017-02-14T01:31:44Z","updated_at":"2017-02-14T01:31:44Z","body":"I would advocate `$Readonly`, typescript has a similar modifier which they have named `Readonly` https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-1.html"}}
{"actor":{"display_login":"cloudkite"}}