Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. return (dispatch) => {
  2. dispatch({
  3. type: POST_TO_DB,
  4. });
  5. firebase.database().ref(locationInDB).push(object)
  6. .then((data) => {
  7. dispatch({
  8. type: POST_TRADE_TO_DB_SUCCESS,
  9. }); // success
  10. })
  11. .catch((err) => {
  12. console.log("failed to post...")
  13. dispatch({
  14. type: POST_TRADE_TO_DB_FAILED,
  15. }); // failed
  16. });
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement