{"action":"created","issue":{"url":"https://api.github.com/repos/LeaVerou/bliss/issues/69","labels_url":"https://api.github.com/repos/LeaVerou/bliss/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/LeaVerou/bliss/issues/69/comments","events_url":"https://api.github.com/repos/LeaVerou/bliss/issues/69/events","html_url":"https://github.com/LeaVerou/bliss/issues/69","id":121360806,"number":69,"title":"Helper to manage function arguments","user":{"login":"LeaVerou","id":175836,"avatar_url":"https://avatars.githubusercontent.com/u/175836?v=3","gravatar_id":"","url":"https://api.github.com/users/LeaVerou","html_url":"https://github.com/LeaVerou","followers_url":"https://api.github.com/users/LeaVerou/followers","following_url":"https://api.github.com/users/LeaVerou/following{/other_user}","gists_url":"https://api.github.com/users/LeaVerou/gists{/gist_id}","starred_url":"https://api.github.com/users/LeaVerou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeaVerou/subscriptions","organizations_url":"https://api.github.com/users/LeaVerou/orgs","repos_url":"https://api.github.com/users/LeaVerou/repos","events_url":"https://api.github.com/users/LeaVerou/events{/privacy}","received_events_url":"https://api.github.com/users/LeaVerou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LeaVerou/bliss/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"dperrymorrow","id":64978,"avatar_url":"https://avatars.githubusercontent.com/u/64978?v=3","gravatar_id":"","url":"https://api.github.com/users/dperrymorrow","html_url":"https://github.com/dperrymorrow","followers_url":"https://api.github.com/users/dperrymorrow/followers","following_url":"https://api.github.com/users/dperrymorrow/following{/other_user}","gists_url":"https://api.github.com/users/dperrymorrow/gists{/gist_id}","starred_url":"https://api.github.com/users/dperrymorrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dperrymorrow/subscriptions","organizations_url":"https://api.github.com/users/dperrymorrow/orgs","repos_url":"https://api.github.com/users/dperrymorrow/repos","events_url":"https://api.github.com/users/dperrymorrow/events{/privacy}","received_events_url":"https://api.github.com/users/dperrymorrow/received_events","type":"User","site_admin":false},"milestone":null,"comments":29,"created_at":"2015-12-09T22:59:10Z","updated_at":"2015-12-17T19:36:08Z","closed_at":null,"body":"This is a very frequent pattern in Bliss: A function which accepts either separate arguments or objects which provide the same values en masse.\r\nHere are a few examples:\r\n\r\n- `$.delegate()` (2 levels of this!)\r\n- `$.lazy()`\r\n- `$.live()`\r\n- `$.set()`\r\n- `$.once()`\r\n- `$.add()`\r\n\r\nAlso, several others that might benefit from similar handling, e.g. `$.events()`.\r\n\r\nI was thinking, it would be nice to have a small helper to handle these cases, so that the functions themselves are only defined for the case of having everything as separate argument, and the helper takes care of looping if the argument is an object instead.\r\nIt doesn't have to handle nested cases of this, since that only happens in `$.delegate()`, and we could apply the helper twice there. \r\nThat way, not only the Bliss code will be simplified, but also our users get a helper function that might help them on their own code too.\r\nI spent some time thinking about this before releasing Bliss, but couldn't come up with a good idea for a good API for such a helper. Let’s brainstorm in this thread if you think it's worthwhile!"},"comment":{"url":"https://api.github.com/repos/LeaVerou/bliss/issues/comments/165558363","html_url":"https://github.com/LeaVerou/bliss/issues/69#issuecomment-165558363","issue_url":"https://api.github.com/repos/LeaVerou/bliss/issues/69","id":165558363,"user":{"login":"LeaVerou","id":175836,"avatar_url":"https://avatars.githubusercontent.com/u/175836?v=3","gravatar_id":"","url":"https://api.github.com/users/LeaVerou","html_url":"https://github.com/LeaVerou","followers_url":"https://api.github.com/users/LeaVerou/followers","following_url":"https://api.github.com/users/LeaVerou/following{/other_user}","gists_url":"https://api.github.com/users/LeaVerou/gists{/gist_id}","starred_url":"https://api.github.com/users/LeaVerou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeaVerou/subscriptions","organizations_url":"https://api.github.com/users/LeaVerou/orgs","repos_url":"https://api.github.com/users/LeaVerou/repos","events_url":"https://api.github.com/users/LeaVerou/events{/privacy}","received_events_url":"https://api.github.com/users/LeaVerou/received_events","type":"User","site_admin":false},"created_at":"2015-12-17T19:36:08Z","updated_at":"2015-12-17T19:36:08Z","body":"Exactly. Like I said, I love heuristics too, but good heuristics fulfill two conditions:\r\n\r\n1. The number of use cases where they fail is tiny\r\n2. Opt-out is possible for those use cases."}}