本文整理汇总了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,
示例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)));
示例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);
示例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);
示例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);
示例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)));
示例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(
示例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,
示例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);
示例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,