{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/firebase-util/issues/56","labels_url":"https://api.github.com/repos/firebase/firebase-util/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/firebase/firebase-util/issues/56/comments","events_url":"https://api.github.com/repos/firebase/firebase-util/issues/56/events","html_url":"https://github.com/firebase/firebase-util/issues/56","id":93103337,"number":56,"title":"Call the functions defined by $firebaseArray.$add({...}).then when promise is fulfilled or rejected","user":{"login":"devotis","id":465989,"avatar_url":"https://avatars.githubusercontent.com/u/465989?v=3","gravatar_id":"","url":"https://api.github.com/users/devotis","html_url":"https://github.com/devotis","followers_url":"https://api.github.com/users/devotis/followers","following_url":"https://api.github.com/users/devotis/following{/other_user}","gists_url":"https://api.github.com/users/devotis/gists{/gist_id}","starred_url":"https://api.github.com/users/devotis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devotis/subscriptions","organizations_url":"https://api.github.com/users/devotis/orgs","repos_url":"https://api.github.com/users/devotis/repos","events_url":"https://api.github.com/users/devotis/events{/privacy}","received_events_url":"https://api.github.com/users/devotis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-05T11:21:00Z","updated_at":"2015-10-28T20:01:15Z","closed_at":null,"body":"Currently in `$firebaseArray(ref).$add({...}).then(onFulfilled, onRejected);`, the functions onFulfilled and onRejected are not called.\r\n\r\nIt's practical for me to happen so that I can get a reference to the item that was added by the user adding it. Currently I use $watch on the firebaseArray now, but I needed to build something special to filter out other events that where triggered by other users actions on the same array.\r\n\r\nMy code can become simpler if those oFulfilled and onRejected functions are called.\r\n\r\n@katowulf Can you give me some pointers on where to implement this in firebase-util?\r\n\r\n*Here's a fiddle that compare push and $add: http://jsfiddle.net/devotis/869sgr01/2/*"},"comment":{"url":"https://api.github.com/repos/firebase/firebase-util/issues/comments/151973516","html_url":"https://github.com/firebase/firebase-util/issues/56#issuecomment-151973516","issue_url":"https://api.github.com/repos/firebase/firebase-util/issues/56","id":151973516,"user":{"login":"maxrevilo","id":1119699,"avatar_url":"https://avatars.githubusercontent.com/u/1119699?v=3","gravatar_id":"","url":"https://api.github.com/users/maxrevilo","html_url":"https://github.com/maxrevilo","followers_url":"https://api.github.com/users/maxrevilo/followers","following_url":"https://api.github.com/users/maxrevilo/following{/other_user}","gists_url":"https://api.github.com/users/maxrevilo/gists{/gist_id}","starred_url":"https://api.github.com/users/maxrevilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxrevilo/subscriptions","organizations_url":"https://api.github.com/users/maxrevilo/orgs","repos_url":"https://api.github.com/users/maxrevilo/repos","events_url":"https://api.github.com/users/maxrevilo/events{/privacy}","received_events_url":"https://api.github.com/users/maxrevilo/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T20:01:15Z","updated_at":"2015-10-28T20:01:15Z","body":"Yes your are right, should be the former. Seems pretty easy I'll try to make te PR as soon as I can.\r\n\r\nWe can also consider to change `getErrors` from\r\n```javascript\r\nreturn this.errors.slice(0);\r\n```\r\nto:\r\n```javascript\r\nreturn this.errors.length? this.errors.slice(0): [null];\r\n```\r\nAnd that way the logic gets encapsulated. But I'm not sure if returning `[null]` on `getErrors` is an acceptable solution.\r\n\r\n"}}