Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return (dispatch) => {
- dispatch({
- type: POST_TO_DB,
- });
- firebase.database().ref(locationInDB).push(object)
- .then((data) => {
- dispatch({
- type: POST_TRADE_TO_DB_SUCCESS,
- }); // success
- })
- .catch((err) => {
- console.log("failed to post...")
- dispatch({
- type: POST_TRADE_TO_DB_FAILED,
- }); // failed
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement