loop-modules
Version:
Shared modules for the Loop product suite.
31 lines (30 loc) • 964 B
JavaScript
import { type } from '../utils/type';
var CATEGORY = 'LoopActivity';
export var ActionTypes = {
QUERY: type("[" + CATEGORY + "] Query"),
SET_ENTRIES: type("[" + CATEGORY + "] Set Entries")
};
/**
* Every action is comprised of at least a type and an optional
* payload. Expressing actions as classes enables powerful
* type checking in reducer functions.
*
* See Discriminated Unions: https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
*/
var QueryAction = (function () {
function QueryAction(payload) {
this.payload = payload;
this.type = ActionTypes.QUERY;
}
return QueryAction;
}());
export { QueryAction };
var SetEntriesAction = (function () {
function SetEntriesAction(payload) {
if (payload === void 0) { payload = []; }
this.payload = payload;
this.type = ActionTypes.SET_ENTRIES;
}
return SetEntriesAction;
}());
export { SetEntriesAction };