client/src/actions/sessionsActions.js
author ymh <ymh.work@gmail.com>
Thu, 15 Jun 2017 15:27:36 +0200
changeset 40 7f940dbb60a6
parent 30 4d93f4ed95bc
child 58 f16a080e0bc4
permissions -rw-r--r--
Use yields instead of promises

import uuidV1 from 'uuid/v1';

import * as types from '../constants/actionTypes';

export const createSession = () => {
  return {
    type: types.CREATE_SESSION_ASYNC,
    session: {
      _id: uuidV1(),
      date: new Date(),
      title: '',
      description: '',
    }
  };
}

export const updateSession = (session, values) => {
  return {
    type: types.UPDATE_SESSION_ASYNC,
    session: session,
    values: values,
  };
}

export const loadSessions = () => {
  return {
    type: types.LOAD_SESSIONS_ASYNC
  }
}