How to use react-suber - 3 common examples

To help you get started, we’ve selected a few react-suber 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 neo4j / neo4j-browser / src / browser / modules / User / UserInfo.jsx View on Github external
const mapStateToProps = state => {
  return {
    info: getCurrentUser(state)
  }
}

const mapDispatchToProps = dispatch => {
  return {
    updateCurrentUser: (username, roles) => {
      dispatch(updateCurrentUser(username, roles))
    }
  }
}

const UserInfo = withBus(
  connect(mapStateToProps, mapDispatchToProps)(UserInfoComponent)
)
export default UserInfo
github neo4j / neo4j-browser / src / browser / modules / Sidebar / favorites.js View on Github external
})
const mergeProps = (stateProps, dispatchProps) => {
  return {
    ...stateProps,
    ...dispatchProps,
    onExportScripts: () => dispatchProps.onExportScripts(stateProps.scripts),
    onUpdateFolder: (favorites, payload) =>
      dispatchProps.onUpdateFolder(
        favorites,
        payload,
        stateProps.scripts,
        stateProps.folders
      )
  }
}
const Favorites = withBus(
  connect(
    mapFavoritesStateToProps,
    mapFavoritesDispatchToProps,
    mergeProps
  )(MyScripts)
)

export default Favorites
github neo4j / neo4j-browser / src / browser / modules / Sidebar / static-scripts.js View on Github external
isStatic: true
  }
}
const mapFavoritesDispatchToProps = (dispatch, ownProps) => ({
  onSelectScript: favorite =>
    ownProps.bus.send(
      editor.EDIT_CONTENT,
      editor.editContent(favorite.id, favorite.contents)
    ),
  onExecScript: favorite => dispatch(executeCommand(favorite.contents)),
  onExportScripts: Function.prototype,
  onRemoveScript: Function.prototype,
  onUpdateFolder: Function.prototype,
  onRemoveFolder: Function.prototype
})
const Favorites = withBus(
  connect(mapFavoritesStateToProps, mapFavoritesDispatchToProps)(MyScripts)
)

export default Favorites

react-suber

Binding function 'withBus' between React and Suber

MIT
Latest version published 6 years ago

Package Health Score

42 / 100
Full package analysis

Popular react-suber functions