{"action":"created","issue":{"url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/5","repository_url":"https://api.github.com/repos/nmoskalenko/RxFirebase","labels_url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/5/comments","events_url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/5/events","html_url":"https://github.com/nmoskalenko/RxFirebase/issues/5","id":168194827,"number":5,"title":"Returning datasnapshot keys from children event listener","user":{"login":"ahaverty","id":2920947,"avatar_url":"https://avatars.githubusercontent.com/u/2920947?v=3","gravatar_id":"","url":"https://api.github.com/users/ahaverty","html_url":"https://github.com/ahaverty","followers_url":"https://api.github.com/users/ahaverty/followers","following_url":"https://api.github.com/users/ahaverty/following{/other_user}","gists_url":"https://api.github.com/users/ahaverty/gists{/gist_id}","starred_url":"https://api.github.com/users/ahaverty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahaverty/subscriptions","organizations_url":"https://api.github.com/users/ahaverty/orgs","repos_url":"https://api.github.com/users/ahaverty/repos","events_url":"https://api.github.com/users/ahaverty/events{/privacy}","received_events_url":"https://api.github.com/users/ahaverty/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-28T20:56:37Z","updated_at":"2016-09-10T01:35:59Z","closed_at":null,"body":"I'm not sure about everyone else but I personally use datasnapshot keys (.getKey()) quite a bit, especially on child listeners. Below shows an example of what I currently have adapted things to locally. I'd make a pull request but I'd imagine a change like this would mess with existing code if anyone were to upgrade.\r\nWhat do you suggest? Would anyone else make use of this? I guess one solution is to duplicate every method\r\n**E.G:**\r\n```java\r\nobserveChildrenEvents(query, clazz);\r\n//Stays as is\r\n\r\nobserveChildrenEventsWithKey(query, clazz);\r\n//Returns the datasnapshot's key also\r\n```\r\n\r\nIt seems like a horrible workaround though. Or would something like this be better?:\r\n```java\r\nobserveChildrenEvents(query, clazz);\r\n//Stays as is\r\n\r\nobserveChildrenEvents(query, clazz, boolean returnKey);\r\n//Returns the datasnapshot's key also\r\n```\r\nAtleast this way, the code could be encapsulated, and wouldn't effect anyone upgrading?\r\n\r\n\r\n**Partial example of what was, and what I now have:**\r\n\r\nCurrent:\r\n```java\r\n@Override\r\npublic void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {\r\n    if (!subscriber.isUnsubscribed()) {\r\n        subscriber.onNext(\r\n            new RxFirebaseChildEvent<T>(dataSnapshot.getValue(clazz),\r\n            previousChildName,\r\n            RxFirebaseChildEvent.EventType.ADDED));\r\n    }\r\n}\r\n```\r\n\r\nProposition:\r\n```java\r\n@Override\r\npublic void onChildAdded(DataSnapshot dataSnapshot, String previousChildName) {\r\n    if (!subscriber.isUnsubscribed()) {\r\n        subscriber.onNext(\r\n            new RxFirebaseChildEvent<T>(dataSnapshot.getValue(clazz),\r\n            dataSnapshot.getKey(), //<- Notice returning key also\r\n            previousChildName,\r\n            RxFirebaseChildEvent.EventType.ADDED));\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/comments/246079890","html_url":"https://github.com/nmoskalenko/RxFirebase/issues/5#issuecomment-246079890","issue_url":"https://api.github.com/repos/nmoskalenko/RxFirebase/issues/5","id":246079890,"user":{"login":"nmoskalenko","id":1143242,"avatar_url":"https://avatars.githubusercontent.com/u/1143242?v=3","gravatar_id":"","url":"https://api.github.com/users/nmoskalenko","html_url":"https://github.com/nmoskalenko","followers_url":"https://api.github.com/users/nmoskalenko/followers","following_url":"https://api.github.com/users/nmoskalenko/following{/other_user}","gists_url":"https://api.github.com/users/nmoskalenko/gists{/gist_id}","starred_url":"https://api.github.com/users/nmoskalenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmoskalenko/subscriptions","organizations_url":"https://api.github.com/users/nmoskalenko/orgs","repos_url":"https://api.github.com/users/nmoskalenko/repos","events_url":"https://api.github.com/users/nmoskalenko/events{/privacy}","received_events_url":"https://api.github.com/users/nmoskalenko/received_events","type":"User","site_admin":false},"created_at":"2016-09-10T01:35:59Z","updated_at":"2016-09-10T01:35:59Z","body":"I've added key value into RxFirebaseChildEvent in ver 0.13"}}
{"actor":{"display_login":"nmoskalenko"}}