Skip to content

Instantly share code, notes, and snippets.

@hedgerh
Forked from phd20/index.tsx
Last active March 23, 2019 00:38
Show Gist options
  • Save hedgerh/3491860f9b2a1a17c51dd15d8b778986 to your computer and use it in GitHub Desktop.
Save hedgerh/3491860f9b2a1a17c51dd15d8b778986 to your computer and use it in GitHub Desktop.
Working version of container that returns array of objects
import { connect } from "react-redux";
import Dashboard from "./dashboard";
import { ApplicationState } from "../../store";
const mapStateToProps = (state: ApplicationState) => {
const sessions = sessionsArraySelector(state)
console.log(sessions)
return {
user: state.oidc.user,
sessions: Object.values(sessions),
};
};
export default connect(mapStateToProps)(Dashboard);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment