• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript reduxsauce.createActions函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中reduxsauce.createActions函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createActions函数的具体用法?TypeScript createActions怎么用?TypeScript createActions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了createActions函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: camelToScreamingSnake

export const createActions = (actions) => {
  const { Creators: Actions } = sauce.createActions(actions);

  Object.keys(actions).forEach((key) => {
    Actions[key].toString = () => camelToScreamingSnake(key);
  });

  return Actions;
};
开发者ID:zanjs,项目名称:wxapp-typescript,代码行数:9,代码来源:createActions.ts


示例2: createActions

export const { Types: RisksTypes, Creators: RisksActions } = createActions({
	fetchRisks: ['teamspace', 'modelId', 'revision'],
	fetchRisksSuccess: ['risks'],
	fetchRisk: ['teamspace', 'modelId', 'riskId'],
	fetchRiskSuccess: ['risk'],
	fetchRiskFailure: [],
	setComponentState: ['componentState'],
	saveRisk: ['teamspace', 'model', 'riskData', 'revision'],
	updateRisk: ['teamspace', 'modelId', 'riskData'],
	postComment: ['teamspace', 'modelId', 'riskData'],
	removeComment: ['teamspace', 'modelId', 'riskData'],
	saveRiskSuccess: ['risk'],
	setNewRisk: [],
	renderPins: [],
	printRisks: ['teamspace', 'modelId'],
	downloadRisks: ['teamspace', 'modelId'],
	showDetails: ['teamspace', 'model', 'revision', 'risk'],
	closeDetails: ['teamspace', 'model', 'revision'],
	setActiveRisk: ['risk', 'revision'],
	showNewPin: ['risk', 'pinData'],
	togglePendingState: ['isPending'],
	toggleDetailsPendingState: ['isPending'],
	subscribeOnRiskChanges: ['teamspace', 'modelId'],
	unsubscribeOnRiskChanges: ['teamspace', 'modelId'],
	focusOnRisk: ['risk', 'revision'],
	toggleShowPins: ['showPins'],
	subscribeOnRiskCommentsChanges: ['teamspace', 'modelId', 'riskId'],
	unsubscribeOnRiskCommentsChanges: ['teamspace', 'modelId', 'riskId'],
	createCommentSuccess: ['comment', 'riskId'],
	deleteCommentSuccess: ['commentGuid', 'riskId'],
	updateCommentSuccess: ['comment', 'riskId'],
	toggleSortOrder: ['sortOrder'],
	updateNewRisk: ['newRisk'],
	setFilters: ['filters'],
	showCloseInfo: ['riskId'],
	resetComponentState: []
}, { prefix: 'RISKS/' });
开发者ID:3drepo,项目名称:3drepo.io,代码行数:37,代码来源:risks.redux.ts


示例3: createActions

import { sortByField } from '../../helpers/sorting';

export const { Types: UserManagementTypes, Creators: UserManagementActions } = createActions({
	fetchTeamspaceDetails: ['teamspace'],
	fetchTeamspaceDetailsSuccess: ['teamspace', 'users', 'currentUser', 'collaboratorLimit'],
	setPendingState: ['isPending'],
	addUser: ['user'],
	addUserSuccess: ['user', 'currentUser'],
	removeUser: ['username'],
	removeUserCascade: ['username'],
	removeUserSuccess: ['username'],
	setTeamspace: ['teamspace'],
	updateJob: ['username', 'job'],
	updateUserJobSuccess: ['username', 'job'],
	updatePermissions: ['permissions'],
	updatePermissionsSuccess: ['permissions', 'currentUser'],
	getUsersSuggestions: ['searchText'],
	getUsersSuggestionsSuccess: ['suggestions'],
	clearUsersSuggestions: [],
	fetchProject: ['project'],
	setProject: ['project'],
	updateProjectPermissions: ['permissions'],
	updateProjectPermissionsSuccess: ['permissions'],
	fetchModelsPermissions: ['models'],
	fetchModelPermissionsSuccess: ['selectedModels'],
	updateModelsPermissions: ['modelsWithPermissions', 'permissions'],
	updateModelsPermissionsPre: ['modelsWithPermissions', 'permissions'],
	updateModelPermissionsSuccess: ['updatedModels', 'permissions']
}, { prefix: 'USER_MANAGEMENT/' });

export const INITIAL_STATE = {
开发者ID:3drepo,项目名称:3drepo.io,代码行数:31,代码来源:userManagement.redux.ts


示例4: createActions

 */

import { createActions, createReducer } from 'reduxsauce';
import { cloneDeep, keyBy } from 'lodash';

export const { Types: ViewpointsTypes, Creators: ViewpointsActions } = createActions({
	setPendingState: ['pendingState'],
	fetchViewpoints: ['teamspace', 'modelId'],
	fetchViewpointsSuccess: ['viewpoints'],
	createViewpoint: ['teamspace', 'modelId', 'viewpoint'],
	createViewpointSuccess: ['viewpoint'],
	updateViewpoint: ['teamspace', 'modelId', 'viewpointId', 'newName'],
	updateViewpointSuccess: ['viewpoint'],
	deleteViewpoint: ['teamspace', 'modelId', 'viewpointId'],
	deleteViewpointSuccess: ['viewpointId'],
	subscribeOnViewpointChanges: ['teamspace', 'modelId'],
	unsubscribeOnViewpointChanges: ['teamspace', 'modelId'],
	showViewpoint: ['teamspace', 'modelId', 'view'],
	setCameraOnViewpoint: ['teamspace', 'modelId', 'view'],
	prepareNewViewpoint: ['teamspace', 'modelId', 'viewpointName'],
	setNewViewpoint: ['newViewpoint'],
	setActiveViewpoint: ['activeViewpoint'],
	setSearchQuery: ['searchQuery'],
	showDeleteInfo: ['viewpointId'],
	setComponentState: ['componentState']
}, { prefix: 'VIEWPOINTS/' });

export interface IViewpointsComponentState {
	activeViewpoint?: number;
	editMode?: boolean;
	newViewpoint?: any;
开发者ID:3drepo,项目名称:3drepo.io,代码行数:31,代码来源:viewpoints.redux.ts


示例5: createActions

 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';
import { isString } from 'lodash';
import { SnackbarProps } from '@material-ui/core/Snackbar';

export const { Types: SnackbarTypes, Creators: SnackbarActions } = createActions({
	show: ['config']
}, { prefix: 'SNACKBAR/' });

export const INITIAL_STATE = {
	snackConfig: {} as SnackbarProps,
	isOpen: false
};

export const show = (state = INITIAL_STATE, action) => {
	const parsedConfig = isString(action.config) ? {message: action.config} : action.config;
	const config = {
		...parsedConfig,
		key: (new Date()).valueOf()
	};
	return { ...state, snackConfig: config, isOpen: true };
};
开发者ID:3drepo,项目名称:3drepo.io,代码行数:31,代码来源:snackbar.redux.ts


示例6: createActions

 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';

export const { Types: GisTypes, Creators: GisActions } = createActions({
	initialiseMap: ['params'],
	initialiseMapSuccess: ['initialised'],
	addSource: ['source'],
	addSourceSuccess: ['source'],
	removeSource: ['source'],
	removeSourceSuccess: ['source'],
	resetSources: [],
	resetSourcesSuccess: [],
	resetMap: []
}, { prefix: 'GIS/' });

export const INITIAL_STATE = {
	initialised: false,
	visibleSources: []
};

export const initialiseMapSuccess = (state = INITIAL_STATE, { initialised }) => {
	return { ...state, initialised };
};
开发者ID:3drepo,项目名称:3drepo.io,代码行数:30,代码来源:gis.redux.ts


示例7: createActions

 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';

export const { Types: CurrentUserTypes, Creators: CurrentUserActions } = createActions({
	fetchUser: ['username'],
	fetchUserSuccess: ['userData'],
	fetchQuotaInfo: ['teamspace'],
	fetchQuotaInfoSuccess: ['quota'],
	fetchUserError: ['error'],
	updateUser: ['userData'],
	updateUserSuccess: ['userData'],
	updateUserPassword: ['passwords'],
	setPendingState: ['pendingState'],
	setAvatarPendingState: ['pendingState'],
	updateButtonText: ['value'],
	uploadAvatar: ['file'],
	refreshAvatar: ['avatarUrl'],
	generateApiKey: [],
	deleteApiKey: [],
	setAsInitialised: []
}, { prefix: 'CURRENT_USER/' });

export const INITIAL_STATE = {
	currentTeamspace: '',
	currentUser: {
		username: ''
	},
	isPending: true,
开发者ID:3drepo,项目名称:3drepo.io,代码行数:32,代码来源:currentUser.redux.ts


示例8: createActions

 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';

export const { Types: TreeTypes, Creators: TreeActions } = createActions({
	startListenOnSelections: [],
	stopListenOnSelections: [],
	clearSelectedNodes: [],
	getSelectedNodes: [],
	getSelectedNodesSuccess: ['selectedNodes'],
	showAllNodes: [],
	hideSelectedNodes: [],
	isolateSelectedNodes: []
}, { prefix: 'TREE/' });

export interface IObjectObjectState {
	selectedNodes: any;
}

export const INITIAL_STATE: IObjectObjectState = {
	selectedNodes: []
};

export const clearSelectedNodes = (state = INITIAL_STATE, {}) => {
	return { ...state, selectedNodes: [] };
开发者ID:3drepo,项目名称:3drepo.io,代码行数:32,代码来源:tree.redux.ts


示例9: createActions

 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';
import { sortByField } from '../../helpers/sorting';

export const { Types: ModelTypes, Creators: ModelActions } = createActions({
	fetchSettings: ['teamspace', 'modelId'],
	fetchSettingsSuccess: ['settings', 'metaKeys'],
	updateSettings: ['modelData', 'settings'],
	fetchRevisions: ['teamspace', 'modelId'],
	fetchRevisionsSuccess: ['revisions'],
	downloadModel: ['teamspace', 'modelId'],
	uploadModelFile: ['teamspace', 'project', 'modelData', 'fileData'],
	setPendingState: ['pendingState'],
	onModelStatusChanged: ['modelData', 'teamspace', 'project', 'modelId', 'modelName'],
	subscribeOnStatusChange: ['teamspace', 'project', 'modelData'],
	unsubscribeOnStatusChange: ['teamspace', 'project', 'modelData'],
	fetchMaps: ['teamspace', 'modelId'],
	fetchMapsSuccess: ['maps'],
	updateSettingsSuccess: ['settings'],
	fetchMetaKeys: ['teamspace', 'modelId'],
	fetchMetaKeysSuccess: ['metaKeys']
}, { prefix: 'MODEL/' });

export const INITIAL_STATE = {
	settings: {properties: {topicTypes: []}},
	metaKeys: [],
	revisions: [],
	isPending: true,
	maps: []
开发者ID:3drepo,项目名称:3drepo.io,代码行数:32,代码来源:model.redux.ts


示例10: createActions

 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

import { createActions, createReducer } from 'reduxsauce';

export const { Types: NotificationsTypes, Creators: NotificationsActions } = createActions({
	sendGetNotifications: [],
	sendDeleteAllNotifications: [],
	confirmSendDeleteAllNotifications: [],
	sendUpdateNotificationRead: ['notificationId', 'read'],
	sendDeleteNotification: ['notificationId'],
	setNotifications: ['notifications'],
	upsertNotification: ['notification'],
	deleteNotification: ['notification'],
	patchNotification: ['notificationPatch'],
	patchAllNotifications: ['notificationPatch'],
	showUpdatedFailedError: ['errorMessage'],
	setDrawerPanelState: ['drawerOpened'],
	sendUpdateAllNotificationsRead: ['read']
}, { prefix: 'NOTIFICATIONS/' });

export const INITIAL_STATE = {
	notifications: []
};

export const setNotifications = (state = INITIAL_STATE, { notifications }) => {
	return {...state, notifications};
};
开发者ID:3drepo,项目名称:3drepo.io,代码行数:31,代码来源:notifications.redux.ts



注:本文中的reduxsauce.createActions函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript reduxsauce.createReducer函数代码示例发布时间:2022-05-25
下一篇:
TypeScript redux-typed-modules.Module类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap