File size: 376 Bytes
181e22f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import axios from 'axios';
import * as types from '../common/actionTypes';

export function sendHello (msg, callback = () => {}) {
  return (dispatch) => {
    axios.post('/api/hello', {
      msg,
    })
    .then((res) => {
      console.log('## res is: ', res.data)
      dispatch({
        type: types.UPDATE_HELLO_MSG,
        payload: res.data,
      });
    });
  };
}