{"action":"created","issue":{"url":"https://api.github.com/repos/zenparsing/es-observable/issues/43","labels_url":"https://api.github.com/repos/zenparsing/es-observable/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/zenparsing/es-observable/issues/43/comments","events_url":"https://api.github.com/repos/zenparsing/es-observable/issues/43/events","html_url":"https://github.com/zenparsing/es-observable/issues/43","id":94756249,"number":43,"title":"Bikeshedding:  Observer interface","user":{"login":"zenparsing","id":5995084,"avatar_url":"https://avatars.githubusercontent.com/u/5995084?v=3","gravatar_id":"","url":"https://api.github.com/users/zenparsing","html_url":"https://github.com/zenparsing","followers_url":"https://api.github.com/users/zenparsing/followers","following_url":"https://api.github.com/users/zenparsing/following{/other_user}","gists_url":"https://api.github.com/users/zenparsing/gists{/gist_id}","starred_url":"https://api.github.com/users/zenparsing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenparsing/subscriptions","organizations_url":"https://api.github.com/users/zenparsing/orgs","repos_url":"https://api.github.com/users/zenparsing/repos","events_url":"https://api.github.com/users/zenparsing/events{/privacy}","received_events_url":"https://api.github.com/users/zenparsing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-13T16:05:40Z","updated_at":"2015-07-13T16:41:03Z","closed_at":null,"body":"Let's suppose that we go back to accepting/passing observers instead of multiple callbacks.  What should the interface for Observer be?\r\n\r\nIn Rx, it is:\r\n\r\n```\r\ninterface Observer {\r\n    onNext(value : any) : void;\r\n    onError(error : any) : void;\r\n    onComplete() : void;\r\n}\r\n```\r\n\r\nI think that the camel-cased \"on*\" names look a little out-of-place in JS and the DOM.  Also, I would like it if the callbacks could return values as well;  that would support use cases like async observers without introducing an additional type.\r\n\r\nAlso, since iterators can technically \"return\" values, I think we should allow \"complete\" to accept values as well.\r\n\r\nFurthermore, (and more experimentally) I think it *might* be useful to also provide a reference to the subscription along with the value, so that the method can call `unsubscribe` at any time.\r\n\r\nProposal:\r\n\r\n```\r\ninterface Observer {\r\n    next(value : any, subscription : Subscription) : any;\r\n    error(value: any) : any;\r\n    complete(value: any) : any;\r\n}\r\n```\r\n\r\nThoughts?  Any other proposals?"},"comment":{"url":"https://api.github.com/repos/zenparsing/es-observable/issues/comments/120989485","html_url":"https://github.com/zenparsing/es-observable/issues/43#issuecomment-120989485","issue_url":"https://api.github.com/repos/zenparsing/es-observable/issues/43","id":120989485,"user":{"login":"blesh","id":1540597,"avatar_url":"https://avatars.githubusercontent.com/u/1540597?v=3","gravatar_id":"","url":"https://api.github.com/users/blesh","html_url":"https://github.com/blesh","followers_url":"https://api.github.com/users/blesh/followers","following_url":"https://api.github.com/users/blesh/following{/other_user}","gists_url":"https://api.github.com/users/blesh/gists{/gist_id}","starred_url":"https://api.github.com/users/blesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blesh/subscriptions","organizations_url":"https://api.github.com/users/blesh/orgs","repos_url":"https://api.github.com/users/blesh/repos","events_url":"https://api.github.com/users/blesh/events{/privacy}","received_events_url":"https://api.github.com/users/blesh/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T16:41:03Z","updated_at":"2015-07-13T16:41:03Z","body":"The second proposal is almost identical to what I've done in ReactiveX/RxJS over the weekend. So no complaints here"}}