client/src/actions/networkActions.js
author salimr <riwad.salim@yahoo.fr>
Mon, 08 Oct 2018 03:24:47 +0200
changeset 159 a4705c2b4544
parent 129 d48946d164c6
permissions -rw-r--r--
Add send note options to the editor
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
87
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import * as types from '../constants/actionTypes';
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
export const dataFetchSuccess = (res) => {
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
  return {
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
    type: types.DATA_FETCH_SUCCESS,
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    res
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
  };
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
}
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    10
export const setOnlineStatus = (status) => {
87
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
  return {
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    12
    type: status?types.STATUS_ONLINE:types.STATUS_OFFLINE
87
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
  }
dbcee57de2c6 Add first implementation of network monitor
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
}
129
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    15
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    16
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    17
export const forceSync = () => {
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    18
  return {
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    19
    type: types.SYNC_DO_SYNC
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    20
  }
d48946d164c6 Add a first version of synchronisation
ymh <ymh.work@gmail.com>
parents: 87
diff changeset
    21
}