jiti-meet/react/features/calendar-sync/actions.js

52 lines
1.0 KiB
JavaScript
Raw Normal View History

2018-02-08 18:50:19 +00:00
// @flow
2018-02-14 16:50:48 +00:00
import {
NEW_CALENDAR_ENTRY_LIST,
NEW_KNOWN_DOMAIN,
REFRESH_CALENDAR_ENTRY_LIST
} from './actionTypes';
2018-02-08 18:50:19 +00:00
/**
2018-02-14 16:50:48 +00:00
* Sends an action to add a new known domain if not present yet.
2018-02-08 18:50:19 +00:00
*
2018-02-14 16:50:48 +00:00
* @param {string} domainName - The new domain.
2018-02-08 18:50:19 +00:00
* @returns {{
2018-02-14 16:50:48 +00:00
* type: NEW_KNOWN_DOMAIN,
* domainName: string
2018-02-08 18:50:19 +00:00
* }}
*/
2018-02-14 16:50:48 +00:00
export function maybeAddNewKnownDomain(domainName: string) {
2018-02-08 18:50:19 +00:00
return {
2018-02-14 16:50:48 +00:00
type: NEW_KNOWN_DOMAIN,
domainName
2018-02-08 18:50:19 +00:00
};
}
2018-02-14 16:21:52 +00:00
/**
2018-02-14 16:50:48 +00:00
* Sends an action to refresh the entry list (fetches new data).
2018-02-14 16:21:52 +00:00
*
* @returns {{
2018-02-14 16:50:48 +00:00
* type: REFRESH_CALENDAR_ENTRY_LIST
2018-02-14 16:21:52 +00:00
* }}
*/
2018-02-14 16:50:48 +00:00
export function refreshCalendarEntryList() {
2018-02-14 16:21:52 +00:00
return {
2018-02-14 16:50:48 +00:00
type: REFRESH_CALENDAR_ENTRY_LIST
};
}
/**
* Sends an action to update the current calendar list in redux.
*
* @param {Array<Object>} events - The new list.
* @returns {{
* type: NEW_CALENDAR_ENTRY_LIST,
* events: Array<Object>
* }}
*/
export function updateCalendarEntryList(events: Array<Object>) {
return {
type: NEW_CALENDAR_ENTRY_LIST,
events
2018-02-14 16:21:52 +00:00
};
}