當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript reselect.createStructuredSelector函數代碼示例

本文整理匯總了TypeScript中reselect.createStructuredSelector函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript createStructuredSelector函數的具體用法?TypeScript createStructuredSelector怎麽用?TypeScript createStructuredSelector使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了createStructuredSelector函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createStructuredSelector

import { connect } from '../../helpers/migration';

import { Teamspaces } from './teamspaces.component';
import { selectCurrentTeamspace } from '../../modules/currentUser';
import { TeamspacesActions,
	selectIsPending,
	selectTeamspaces,
	selectActiveProject,
	selectActiveTeamspace
} from '../../modules/teamspaces';
import { ModelActions } from './../../modules/model';
import { DialogActions } from '../../modules/dialog';
const mapStateToProps = createStructuredSelector({
	currentTeamspace: selectCurrentTeamspace,
	teamspaces: selectTeamspaces,
	isPending: selectIsPending,
	activeProject: selectActiveProject,
	activeTeamspace: selectActiveTeamspace
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	showDialog: DialogActions.showDialog,
	showConfirmDialog: DialogActions.showConfirmDialog,
	createProject: TeamspacesActions.createProject,
	updateProject: TeamspacesActions.updateProject,
	removeProject: TeamspacesActions.removeProject,
	createModel: TeamspacesActions.createModel,
	updateModel: TeamspacesActions.updateModel,
	removeModel: TeamspacesActions.removeModel,
	fetchTeamspaces: TeamspacesActions.fetchTeamspaces,
	downloadModel: ModelActions.downloadModel,
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:31,代碼來源:teamspaces.container.ts

示例2: createStructuredSelector

 *  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 { bindActionCreators } from 'redux';
import { createStructuredSelector } from 'reselect';
import { withRouter } from 'react-router-dom';
import { connect, addRouting } from '../../helpers/migration';

import { Dashboard } from './dashboard.component';
import {
	selectCurrentUser,
	selectIsInitialised,
	selectIsAvatarPending,
	selectIsPending,
	CurrentUserActions
} from '../../modules/currentUser';

const mapStateToProps = createStructuredSelector({
	currentUser: selectCurrentUser,
	isInitialised: selectIsInitialised,
	isPending: selectIsPending,
	isAvatarPending: selectIsAvatarPending
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	fetchUser: CurrentUserActions.fetchUser
}, dispatch);

export default addRouting(withRouter(connect(mapStateToProps, mapDispatchToProps)(Dashboard)));
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:dashboard.container.ts

示例3: createStructuredSelector

 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  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 { connect } from '../../helpers/migration';
import { bindActionCreators } from 'redux';
import { createStructuredSelector } from 'reselect';

import { ProjectsPermissions } from './projectsPermissions.component';
import { selectExtendedProjectPermissions, UserManagementActions } from '../../modules/userManagement';

const mapStateToProps = createStructuredSelector({
	permissions: selectExtendedProjectPermissions
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	onPermissionsChange: UserManagementActions.updateProjectPermissions
}, dispatch);

export default connect(mapStateToProps, mapDispatchToProps)(ProjectsPermissions);
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:projectsPermissions.container.ts

示例4: createStructuredSelector

 *  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 { bindActionCreators } from 'redux';
import { createStructuredSelector } from 'reselect';
import { connect } from '../../helpers/migration';

import { History } from './history.component';
import { selectCurrentTeamspace } from './../../modules/currentUser';
import { BillingActions, selectInvoices, selectIsPending } from './../../modules/billing';

const mapStateToProps = createStructuredSelector({
	teamspace: selectCurrentTeamspace,
	invoices: selectInvoices,
	isLoadingBilling: selectIsPending
});

export const mapDispatchToProps = (dispatch) =>
	bindActionCreators({
		fetchInvoices: BillingActions.fetchInvoices,
		downloadInvoice: BillingActions.downloadInvoice
	}, dispatch);

export default connect(
	mapStateToProps,
	mapDispatchToProps
)(History);
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:history.container.ts

示例5: createStructuredSelector

 *  License, or (at your option) any later version.
 *
 *  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 { bindActionCreators } from 'redux';
import { createStructuredSelector } from 'reselect';
import { connect } from '../../helpers/migration';
import { ModelActions, selectSettings, selectIsPending } from './../../modules/model';
import { ModelSettings } from './modelSettings.component';
import { selectCurrentTeamspace } from './../../modules/userManagement';

const mapStateToProps = createStructuredSelector({
	currentTeamspace: selectCurrentTeamspace,
	modelSettings: selectSettings,
	isSettingsLoading: selectIsPending
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	fetchModelSettings: ModelActions.fetchSettings,
	updateModelSettings: ModelActions.updateSettings
}, dispatch);

export default connect(mapStateToProps, mapDispatchToProps)(ModelSettings);
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:modelSettings.container.ts

示例6: createStructuredSelector

 *  License, or (at your option) any later version.
 *
 *  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 { bindActionCreators } from 'redux';
import { createStructuredSelector } from 'reselect';
import { withRouter } from 'react-router-dom';
import { connect, addRouting } from '../../helpers/migration';

import { PasswordChange } from './passwordChange.component';
import { AuthActions, selectIsPending, selectMessage } from '../../modules/auth';

const mapStateToProps = createStructuredSelector({
	isPending: selectIsPending,
	message: selectMessage
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	changePassword: AuthActions.changePassword,
	clearMessage: AuthActions.clearAuthMessage
}, dispatch);

export default addRouting(withRouter(connect(mapStateToProps, mapDispatchToProps)(PasswordChange)));
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:passwordChange.container.ts

示例7: createStructuredSelector

import {
	CurrentUserActions,
	selectCurrentTeamspace,
	selectSpaceInfo
} from '../../modules/currentUser';
import {
	BillingActions,
	selectLicencesInfo,
	selectBillingInfo,
	selectIsPending
} from '../../modules/billing';

const mapStateToProps = createStructuredSelector({
	billingInfo: selectBillingInfo,
	teamspace: selectCurrentTeamspace,
	spaceInfo: selectSpaceInfo,
	licencesInfo: selectLicencesInfo,
	isLoadingBilling: selectIsPending
});

export const mapDispatchToProps = (dispatch) =>
	bindActionCreators(
		{
			fetchQuotaInfo: CurrentUserActions.fetchQuotaInfo,
			fetchBillingData: BillingActions.fetchBillingData,
			changeSubscription: BillingActions.changeSubscription
		},
		dispatch
	);

export default connect(
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:31,代碼來源:subscription.container.ts

示例8: createStructuredSelector

	selectSelectedFilters,
	selectShowPins,
	selectIsRisksPending,
	selectSortOrder,
	selectFetchingDetailsIsPending
} from '../../../../modules/risks';
import { selectJobsList } from '../../../../modules/jobs';
import { selectSettings } from '../../../../modules/model';

const mapStateToProps = createStructuredSelector({
	modelSettings: selectSettings,
	risks: selectRisks,
	jobs: selectJobsList,
	activeRiskId: selectActiveRiskId,
	activeRiskDetails: selectActiveRiskDetails,
	showPins: selectShowPins,
	showDetails: selectShowDetails,
	searchEnabled: selectSearchEnabled,
	selectedFilters: selectSelectedFilters,
	isPending: selectIsRisksPending,
	fetchingDetailsIsPending: selectFetchingDetailsIsPending,
	sortOrder: selectSortOrder
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	fetchRisks: RisksActions.fetchRisks,
	setState: RisksActions.setComponentState,
	setNewRisk: RisksActions.setNewRisk,
	downloadRisks: RisksActions.downloadRisks,
	printRisks: RisksActions.printRisks,
	setActiveRisk: RisksActions.setActiveRisk,
	showRiskDetails: RisksActions.showDetails,
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:32,代碼來源:risks.container.ts

示例9: createStructuredSelector

import {
	UserManagementActions,
	selectCurrentTeamspace,
	selectIsPending,
	selectIsTeamspaceAdmin
} from '../../modules/userManagement';

import { selectTeamspacesWithAdminAccess } from '../../modules/teamspaces/teamspaces.selectors';

import {
	selectCurrentTeamspace as selectDefaultTeamspace,
	selectCurrentUser
} from '../../modules/currentUser';
import { TeamspacesActions } from '../../modules/teamspaces';

const mapStateToProps = createStructuredSelector({
	defaultTeamspace: selectDefaultTeamspace,
	selectedTeamspace: selectCurrentTeamspace,
	teamspaces: selectTeamspacesWithAdminAccess,
	isTeamspaceAdmin: selectIsTeamspaceAdmin,
	isLoadingTeamspace: selectIsPending,
	currentUser: selectCurrentUser
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	fetchTeamspaces: TeamspacesActions.fetchTeamspaces,
	onTeamspaceChange: UserManagementActions.fetchTeamspaceDetails
}, dispatch);

export default connect(mapStateToProps, mapDispatchToProps)(UserManagement);
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:30,代碼來源:userManagement.container.ts

示例10: createStructuredSelector

	IssuesActions,
	selectActiveIssueDetails,
	selectExpandDetails,
	selectFetchingDetailsIsPending,
	selectNewComment,
	selectFailedToLoad
} from '../../../../../../modules/issues';
import { selectSettings, selectTopicTypes } from '../../../../../../modules/model';
import { IssueDetails } from './issueDetails.component';

const mapStateToProps = createStructuredSelector({
	issue: selectActiveIssueDetails,
	jobs: selectJobsList,
	expandDetails: selectExpandDetails,
	fetchingDetailsIsPending: selectFetchingDetailsIsPending,
	newComment: selectNewComment,
	myJob: selectMyJob,
	currentUser: selectCurrentUser,
	settings: selectSettings,
	topicTypes: selectTopicTypes,
	failedToLoad: selectFailedToLoad
});

export const mapDispatchToProps = (dispatch) => bindActionCreators({
	setState: IssuesActions.setComponentState,
	fetchIssue: IssuesActions.fetchIssue,
	saveIssue: IssuesActions.saveIssue,
	updateIssue: IssuesActions.updateIssue,
	postComment: IssuesActions.postComment,
	removeComment: IssuesActions.removeComment,
	showNewPin: IssuesActions.showNewPin,
	subscribeOnIssueCommentsChanges: IssuesActions.subscribeOnIssueCommentsChanges,
開發者ID:3drepo,項目名稱:3drepo.io,代碼行數:32,代碼來源:issueDetails.container.ts


注:本文中的reselect.createStructuredSelector函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。