How to use the reselect.createStructuredSelector function in reselect

To help you get started, we’ve selected a few reselect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ModelChimp / modelchimp / client / app / containers / ProjectPage / index.js View on Github external
);
  }
}

ProjectPage.propTypes = {
  projects: PropTypes.array,
  getProjectData: PropTypes.func,
};

export function mapDispatchToProps(dispatch) {
  return {
    getProjectData: () => dispatch(loadProjectData()),
  };
}

const mapStateToProps = createStructuredSelector({
  // repos: makeSelectRepos(),
  // username: makeSelectUsername(),
  loading: makeSelectLoading(),
  projects: makeSelectProjects(),
});

const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps,
);

const withReducer = injectReducer({ key: 'project', reducer });
const withSaga = injectSaga({ key: 'project', saga });

export default compose(
  withReducer,
github WaftTech / WaftEngine / client / app / containers / Admin / Comment / ViewComment / index.js View on Github external
<button>
              Save
              </button> */}
          
          
        
      
    );
  }
}

const mapStateToProps = createStructuredSelector({
  one: makeSelectOne(),
  loading: makeSelectLoading(),
});

const withConnect = connect(
  mapStateToProps,
  { ...mapDispatchToProps, push },
);

const withReducer = injectReducer({ key: 'blogCommentManagePage', reducer });
const withSaga = injectSaga({ key: 'blogCommentManagePage', saga });

const styles = theme =&gt; ({
  backbtn: {
    padding: 0,
    height: '40px',
github ldvm / LDVMi / src / app / assets_webpack / assistant / javascripts / modules / visualizers / chord / containers / Application.js View on Github external
} else {
      return }
        visualization={lists.size &gt; 0 ?  : }
      /&gt;
    }
  }
}

const statusSelector = createAggregatedPromiseStatusSelector([
  graphStatusSelector,
  searchableLensStatusSelector,
  getConfigurationStatusSelector ]);

const selector = createStructuredSelector({
  graph: graphSelector,
  searchableLens: searchableLensSelector,
  lists: listsSelector,
  publishSettings: publishSettingsSelector,
  status: statusSelector
});

export default connect(selector)(addBodyPadding(Application));
github edp963 / wormhole / rider / rider-webapp / app / containers / Namespace / index.js View on Github external
export function mapDispatchToProps (dispatch) {
  return {
    onLoadAdminAllNamespaces: (resolve) => dispatch(loadAdminAllNamespaces(resolve)),
    onLoadUserNamespaces: (projectId, resolve) => dispatch(loadUserNamespaces(projectId, resolve)),
    onLoadSelectNamespaces: (projectId, resolve) => dispatch(loadSelectNamespaces(projectId, resolve)),
    onAddNamespace: (value, resolve) => dispatch(addNamespace(value, resolve)),
    onEditNamespace: (value, resolve) => dispatch(editNamespace(value, resolve)),
    onLoadDatabasesInstance: (value, resolve) => dispatch(loadDatabasesInstance(value, resolve)),
    onLoadNamespaceDatabase: (value, resolve) => dispatch(loadNamespaceDatabase(value, resolve)),
    onLoadTableNameExist: (value, resolve, reject) => dispatch(loadTableNameExist(value, resolve, reject)),
    onLoadSingleNamespace: (namespaceId, resolve) => dispatch(loadSingleNamespace(namespaceId, resolve)),
    onLoadSingleInstance: (namespaceId, resolve) => dispatch(loadSingleInstance(namespaceId, resolve))
  }
}

const mapStateToProps = createStructuredSelector({
  namespaces: selectNamespaces(),
  error: selectError(),
  modalLoading: selectModalLoading(),
  tableNameExited: selectTableNameExited(),
  dbUrlValue: selectDbUrlValue()
})

export default connect(mapStateToProps, mapDispatchToProps)(Namespace)
github i-novus-llc / n2o-framework / frontend / n2o-notifications / src / Notifications.js View on Github external
"bottom-center",
    "bottom-right"
  ]),
  order: PropTypes.oneOf(["top-down", "down-up"]),
  pauseOnHover: PropTypes.bool,
  stack: PropTypes.array
};

Notifications.defaultProps = {
  position: "top-right",
  order: "top-down",
  pauseOnHover: false,
  stack: []
};

const mapStateToProps = createStructuredSelector({
  stack: stackSelector
});

const mapDispatchToProps = {
  destroy
};

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Notifications);
github prisma-labs / graphql-playground / packages / graphql-playground-react / src / components / FileEditor.tsx View on Github external
)
  }
}

const mapStateToProps = createStructuredSelector({
  value: getFile,
})

export default connect(
  mapStateToProps,
  { onChange: editFile },
)(FileEditor)

const Wrapper = styled.div`
  background: ${p =&gt; p.theme.editorColours.resultBackground};
  position: relative;
  .variable-editor {
    height: 100% !important;
  }
  .CodeMirror {
    background: none !important;
github edp963 / davinci / webapp / app / containers / Organizations / component / ProjectList.tsx View on Github external
onModalOk={this.onModalOk}
            deleteProject={this.deleteProject}
            currentProject={currentProject}
            onCancel={this.hideProjectForm}
            onCheckUniqueName={this.checkUniqueName}
            showEditProjectForm={this.showProjectForm('transfer')}
            wrappedComponentRef={this.refHandlers.ProjectEditForm}
          /&gt;
        
      
    )
  }
}


const mapStateToProps = createStructuredSelector({
  vizs: makeSelectVizs(),
  starUserList: makeSelectStarUserList(),
  loginUser: makeSelectLoginUser(),
  projectDetail: makeSelectCurrentOrganizationProject(),
  organizations: makeSelectOrganizations(),
  currentOrganization: makeSelectCurrentOrganizations(),
  currentOrganizationProjects: makeSelectCurrentOrganizationProjects(),
  currentOrganizationProjectsDetail: makeSelectCurrentOrganizationProjectsDetail(),
  currentOrganizationMembers: makeSelectCurrentOrganizationMembers(),
  collectProjects: makeSelectCollectProjects()
})

export function mapDispatchToProps (dispatch) {
  return {
    onLoadVizs: (pid) =&gt; dispatch(loadVizs(pid)),
    onSetCurrentProject: (option) =&gt; dispatch(setCurrentProject(option)),
github ZhangMYihua / lesson-34 / client / src / components / cart-dropdown / cart-dropdown.component.jsx View on Github external
) : (
        Your cart is empty
      )}
    
     {
        history.push('/checkout');
        dispatch(toggleCartHidden());
      }}
    &gt;
      GO TO CHECKOUT
    
  
);

const mapStateToProps = createStructuredSelector({
  cartItems: selectCartItems
});

export default withRouter(connect(mapStateToProps)(CartDropdown));
github jackdh / RasaTalk / app / containers / HomePage / Snackbar.js View on Github external
);
  }
}

SimpleSnackbar.defaultProps = {};

SimpleSnackbar.propTypes = {
  snackbar: PropTypes.object.isRequired,
  message: PropTypes.string.isRequired,
  close: PropTypes.func.isRequired,
  className: PropTypes.string,
  classes: PropTypes.object,
};

const mapStateToProps = createStructuredSelector({
  snackbar: selectOpen(),
  message: selectMessage(),
});

const mapDispatchToProps = dispatch =&gt; ({
  close: () =&gt; dispatch(hideSnackbar()),
});

const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps,
);

export default compose(
  withStyles(styles1),
  withConnect,