verdnatura-chat/app/actions/app.ts

65 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Action } from 'redux';
import { RootEnum } from '../definitions';
import { APP } from './actionsTypes';
interface IAppStart extends Action {
root: RootEnum;
text?: string;
}
interface ISetMasterDetail extends Action {
isMasterDetail: boolean;
}
2023-02-14 13:47:56 +00:00
interface ISetNotificationPresenceCap extends Action {
show: boolean;
}
export type TActionApp = IAppStart & ISetMasterDetail & ISetNotificationPresenceCap;
interface Params {
root: RootEnum;
[key: string]: any;
}
export function appStart({ root, ...args }: Params): IAppStart {
return {
type: APP.START,
root,
...args
};
}
export function appReady(): Action {
return {
type: APP.READY
};
}
export function appInit(): Action {
return {
type: APP.INIT
};
}
export function appInitLocalSettings(): Action {
return {
type: APP.INIT_LOCAL_SETTINGS
};
}
export function setMasterDetail(isMasterDetail: boolean): ISetMasterDetail {
return {
type: APP.SET_MASTER_DETAIL,
isMasterDetail
};
}
2023-02-14 13:47:56 +00:00
export function setNotificationPresenceCap(show: boolean): ISetNotificationPresenceCap {
return {
type: APP.SET_NOTIFICATION_PRESENCE_CAP,
show
};
}