spee.ch/react/actions/index.js

71 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-01-09 02:06:31 +01:00
// export action types
export const FILE_SELECTED = 'FILE_SELECTED';
export const FILE_CLEAR = 'FILE_CLEAR';
2018-01-10 03:25:38 +01:00
export const METADATA_UPDATE = 'METADATA_UPDATE';
export const CLAIM_UPDATE = 'CLAIM_UPDATE';
export const CHANNEL_UPDATE = 'CHANNEL_UPDATE';
export const SET_PUBLISH_IN_CHANNEL = 'SET_PUBLISH_IN_CHANNEL';
2018-01-11 21:51:38 +01:00
export const PUBLISH_STATUS_UPDATE = 'PUBLISH_STATUS_UPDATE';
export const ERROR_UPDATE = 'ERROR_UPDATE';
2018-01-09 02:06:31 +01:00
// export action creators
export function selectFile (file) {
return {
type: FILE_SELECTED,
file: file,
2018-01-09 02:06:31 +01:00
};
};
export function clearFile () {
return {
type: FILE_CLEAR,
};
};
export function updateMetadata (name, value) {
return {
type: METADATA_UPDATE,
name,
value,
};
};
2018-01-10 03:25:38 +01:00
export function updateClaim (value) {
return {
type: CLAIM_UPDATE,
value,
};
};
export function updateLoggedInChannel (name, shortId, longId) {
return {
type: CHANNEL_UPDATE,
name,
shortId,
longId,
};
};
2018-01-11 21:51:38 +01:00
export function setPublishInChannel (channel) {
2018-01-10 03:25:38 +01:00
return {
type: SET_PUBLISH_IN_CHANNEL,
2018-01-11 21:51:38 +01:00
channel,
};
};
2018-01-12 00:37:32 +01:00
export function updatePublishStatus (status, message) {
2018-01-11 21:51:38 +01:00
return {
type: PUBLISH_STATUS_UPDATE,
status,
2018-01-12 00:37:32 +01:00
message,
2018-01-10 03:25:38 +01:00
};
2018-01-11 21:51:38 +01:00
};
export function updateError (name, value) {
return {
type: ERROR_UPDATE,
name,
value,
};
};