receptor/src/actions/resources.js

11 lines
384 B
JavaScript
Raw Permalink Normal View History

2017-08-20 17:57:57 +02:00
export const UPDATE_RESOURCES = 'UPDATE_RESOURCES';
2017-08-24 14:30:22 +02:00
export const RESOURCES_REMOVED = 'RESOURCES_REMOVED';
2017-09-10 13:34:39 +02:00
import ws_send from '../socket';
export const updateResource = (resource, cb) => dispatch => {
dispatch({ type: UPDATE_RESOURCES, resources: [resource] });
ws_send("UPDATE_RESOURCE", { resource }, cb);
};
// TODO: More resource actions (delete, etc) through this reducer?