{"action":"created","issue":{"url":"https://api.github.com/repos/paldepind/flyd/issues/24","repository_url":"https://api.github.com/repos/paldepind/flyd","labels_url":"https://api.github.com/repos/paldepind/flyd/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/paldepind/flyd/issues/24/comments","events_url":"https://api.github.com/repos/paldepind/flyd/issues/24/events","html_url":"https://github.com/paldepind/flyd/issues/24","id":76054401,"number":24,"title":"Laziness","user":{"login":"iofjuupasli","id":1502968,"avatar_url":"https://avatars.githubusercontent.com/u/1502968?v=3","gravatar_id":"","url":"https://api.github.com/users/iofjuupasli","html_url":"https://github.com/iofjuupasli","followers_url":"https://api.github.com/users/iofjuupasli/followers","following_url":"https://api.github.com/users/iofjuupasli/following{/other_user}","gists_url":"https://api.github.com/users/iofjuupasli/gists{/gist_id}","starred_url":"https://api.github.com/users/iofjuupasli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iofjuupasli/subscriptions","organizations_url":"https://api.github.com/users/iofjuupasli/orgs","repos_url":"https://api.github.com/users/iofjuupasli/repos","events_url":"https://api.github.com/users/iofjuupasli/events{/privacy}","received_events_url":"https://api.github.com/users/iofjuupasli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-13T16:57:27Z","updated_at":"2016-06-06T07:10:05Z","closed_at":null,"body":"> Implementing laziness would be quite easy. But it definitely has some negatives impacts on user friendliness.\r\n\r\nPlease make it without impact on possibility to get value of stream (by default, but it's ok to provide different methods with laziness enabled), and so it'll not create problems with stateful streams.\r\n\r\nIn theory it looks like not so big issue. But when I tried to build idiomatic FRP code with kefir, it was extremely irritatingly. The main problems was with getting current value, and stateful streams. Also there was problems with atomic updates. Bacon sample have broken when I tried to juggle with its restrictions. And it was issue of bacon because same code on kefir works good, although code looks horrible.\r\n\r\nBut when I tried flyd it was so simple to build whatever I want. I stopped worrying about laziness, many restrictions, and started to think more about logic. Most of streams was static, so garbaging it wasn't an issue. But in some places where I create streams in loops it's possible to use end (or use helper that ends temporary stream when needed as in discussion of this issue).\r\n\r\nAlso we should have choice. Flyd interestingly different from other FRP libs. I think many will appreciate advantages of flyd more than its disadvantages."},"comment":{"url":"https://api.github.com/repos/paldepind/flyd/issues/comments/223883674","html_url":"https://github.com/paldepind/flyd/issues/24#issuecomment-223883674","issue_url":"https://api.github.com/repos/paldepind/flyd/issues/24","id":223883674,"user":{"login":"AlexGalays","id":1375586,"avatar_url":"https://avatars.githubusercontent.com/u/1375586?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexGalays","html_url":"https://github.com/AlexGalays","followers_url":"https://api.github.com/users/AlexGalays/followers","following_url":"https://api.github.com/users/AlexGalays/following{/other_user}","gists_url":"https://api.github.com/users/AlexGalays/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexGalays/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexGalays/subscriptions","organizations_url":"https://api.github.com/users/AlexGalays/orgs","repos_url":"https://api.github.com/users/AlexGalays/repos","events_url":"https://api.github.com/users/AlexGalays/events{/privacy}","received_events_url":"https://api.github.com/users/AlexGalays/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T07:10:05Z","updated_at":"2016-06-06T07:10:05Z","body":"Without laziness, how do you realistically handle resource management / memory leaks?\r\n\r\n- Imagine I create a domEvent stream : `function domEvent(element, eventName)`\r\nPresumably, it adds the eventListener eagerly in the domEvent function since there is no concept of whether the stream has demand. When should it stop listening?\r\nIf we take a more imperative approach like in the drag&drop example, how do you dispose of all the the code and streams? Do you have to end all 3 streams and remove all 3 listeners?\r\n\r\n- stream(promise) doesn't end when the promise is resolved. This seems counter intuitive?\r\n\r\nIn general, it's hard to follow which streams need to be ended manually, and which ones are automatically ended by some combinator."}}
{"actor":{"display_login":"AlexGalays"}}