mirador
Version:
An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.
66 lines (60 loc) • 1.33 kB
JavaScript
import ActionTypes from './action-types';
/**
* requestManifest - action creator
*
* @param {String} manifestId
* @memberof ActionCreators
*/
export function requestManifest(manifestId, properties) {
return {
manifestId,
properties,
type: ActionTypes.REQUEST_MANIFEST,
};
}
/**
* receiveManifest - action creator
*
* @param {String} manifestId
* @param {Object} manifestJson
* @memberof ActionCreators
*/
export function receiveManifest(manifestId, manifestJson) {
return {
manifestId,
manifestJson,
type: ActionTypes.RECEIVE_MANIFEST,
};
}
/**
* receiveManifestFailure - action creator
*
* @param {String} windowId
* @param {String} error
* @memberof ActionCreators
*/
export function receiveManifestFailure(manifestId, error) {
return {
error,
manifestId,
type: ActionTypes.RECEIVE_MANIFEST_FAILURE,
};
}
/**
* fetchManifest - action creator
*
* @param {String} manifestId
* @memberof ActionCreators
*/
export function fetchManifest(manifestId, properties) {
return requestManifest(manifestId, { ...properties, isFetching: true });
}
/**
* removeManifest - action creator
*
* @param {String} manifestId
* @memberof ActionCreators
*/
export function removeManifest(manifestId) {
return { manifestId, type: ActionTypes.REMOVE_MANIFEST };
}