{"action":"created","issue":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/1067","repository_url":"https://api.github.com/repos/mxcl/PromiseKit","labels_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/1067/labels{/name}","comments_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/1067/comments","events_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/1067/events","html_url":"https://github.com/mxcl/PromiseKit/issues/1067","id":453419682,"node_id":"MDU6SXNzdWU0NTM0MTk2ODI=","number":1067,"title":"Use promise and gurantee interchangeably","user":{"login":"Yannmm","id":13806962,"node_id":"MDQ6VXNlcjEzODA2OTYy","avatar_url":"https://avatars3.githubusercontent.com/u/13806962?v=4","gravatar_id":"","url":"https://api.github.com/users/Yannmm","html_url":"https://github.com/Yannmm","followers_url":"https://api.github.com/users/Yannmm/followers","following_url":"https://api.github.com/users/Yannmm/following{/other_user}","gists_url":"https://api.github.com/users/Yannmm/gists{/gist_id}","starred_url":"https://api.github.com/users/Yannmm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yannmm/subscriptions","organizations_url":"https://api.github.com/users/Yannmm/orgs","repos_url":"https://api.github.com/users/Yannmm/repos","events_url":"https://api.github.com/users/Yannmm/events{/privacy}","received_events_url":"https://api.github.com/users/Yannmm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-07T09:26:18Z","updated_at":"2019-06-07T14:58:06Z","closed_at":null,"author_association":"NONE","body":"Hey, I'm new to PMK. So I start by reading [GettingStarted.md](https://github.com/mxcl/PromiseKit/blob/master/Documentation/GettingStarted.md).\r\n\r\nIt says we can use Use promise and guarantee interchangeably. And here's the sample provided:\r\n\r\n```\r\nfunc fetch() -> Promise<String> {\r\n    return Guarantee { seal in\r\n        fetch { result in\r\n            seal(result)\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nHowever, this won't build and the compiler says:\r\n\r\n`Cannot convert return expression of type 'Guarantee<String>' to return type 'Promise<String>'`\r\n\r\nI went through the source code. It seems `Promise` and `Guarantee` are two different classes, only share common ground by `Thenable` protocol.\r\n\r\nSo is the guide wrong or I miss something?\r\n\r\nThank you for the great work. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mxcl/PromiseKit/issues/comments/499918211","html_url":"https://github.com/mxcl/PromiseKit/issues/1067#issuecomment-499918211","issue_url":"https://api.github.com/repos/mxcl/PromiseKit/issues/1067","id":499918211,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5OTkxODIxMQ==","user":{"login":"mxcl","id":58962,"node_id":"MDQ6VXNlcjU4OTYy","avatar_url":"https://avatars2.githubusercontent.com/u/58962?v=4","gravatar_id":"","url":"https://api.github.com/users/mxcl","html_url":"https://github.com/mxcl","followers_url":"https://api.github.com/users/mxcl/followers","following_url":"https://api.github.com/users/mxcl/following{/other_user}","gists_url":"https://api.github.com/users/mxcl/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcl/subscriptions","organizations_url":"https://api.github.com/users/mxcl/orgs","repos_url":"https://api.github.com/users/mxcl/repos","events_url":"https://api.github.com/users/mxcl/events{/privacy}","received_events_url":"https://api.github.com/users/mxcl/received_events","type":"User","site_admin":false},"created_at":"2019-06-07T14:58:06Z","updated_at":"2019-06-07T14:58:06Z","author_association":"OWNER","body":"Docs are wrong I think, you have to do `Promise(guarantee)`.\r\n\r\nYou can use them interchangeable if you return `Thenable` but this requires a lot of generics trickery to get right and I wouldn't recommend it."}}
{"actor":{"display_login":"mxcl"}}