{"action":"closed","issue":{"url":"https://api.github.com/repos/jvanbruegge/cyclejs-test-helpers/issues/1","repository_url":"https://api.github.com/repos/jvanbruegge/cyclejs-test-helpers","labels_url":"https://api.github.com/repos/jvanbruegge/cyclejs-test-helpers/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jvanbruegge/cyclejs-test-helpers/issues/1/comments","events_url":"https://api.github.com/repos/jvanbruegge/cyclejs-test-helpers/issues/1/events","html_url":"https://github.com/jvanbruegge/cyclejs-test-helpers/issues/1","id":308481176,"number":1,"title":"Testing onionify readonly component with addPrevState","user":{"login":"nlarche","id":3041222,"avatar_url":"https://avatars2.githubusercontent.com/u/3041222?v=4","gravatar_id":"","url":"https://api.github.com/users/nlarche","html_url":"https://github.com/nlarche","followers_url":"https://api.github.com/users/nlarche/followers","following_url":"https://api.github.com/users/nlarche/following{/other_user}","gists_url":"https://api.github.com/users/nlarche/gists{/gist_id}","starred_url":"https://api.github.com/users/nlarche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nlarche/subscriptions","organizations_url":"https://api.github.com/users/nlarche/orgs","repos_url":"https://api.github.com/users/nlarche/repos","events_url":"https://api.github.com/users/nlarche/events{/privacy}","received_events_url":"https://api.github.com/users/nlarche/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-26T08:44:28Z","updated_at":"2018-03-28T14:03:38Z","closed_at":"2018-03-28T14:03:38Z","author_association":"CONTRIBUTOR","body":"It's not possible to use the addPrevState method with a cyclejs component which is only reading the state and which isn't returning onion sinks.\r\n\r\nI think this method might be updated with something like this :\r\n\r\n```js\r\nexport function addPrevState(main : any, prevState : any) : any {\r\n    return function(sources : any) : any {\r\n        const initReducer = xs.of(() => prevState);\r\n        const appSinks = main(sources);\r\n        return {\r\n            ...appSinks,\r\n            onion: xs.merge(initReducer, appSinks.onion || xs.empty())\r\n        };\r\n    };\r\n}\r\n```\r\nOr we might create another method to test readonly component ?\r\n\r\nwhat do you think about this , I can make a PR, if you need ?"}}
{"actor":{"display_login":"jvanbruegge"}}