Skip to content

Commit

Permalink
update function names
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Jan 9, 2024
1 parent ca96e27 commit 678ee4e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/HOCs/WithLeaderboard/WithLeaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { fetchLeaderboard, fetchLeaderboardForUser, fetchReviewerLeaderboard,
*
* @author [Neil Rotstan](https://github.com/nrotstan)
*/
const WithLeaderboard = function(WrappedComponent, initialMonthsPast=1, initialOptions={}) {
class WithLeaderboardClass extends Component {
const WithCurrentLeaderboard = function(WrappedComponent, initialMonthsPast=1, initialOptions={}) {
class WithCurrentLeaderboardClass extends Component {
state = {
leaderboard: null,
leaderboardLoading: false,
Expand Down Expand Up @@ -226,13 +226,14 @@ const WithLeaderboard = function(WrappedComponent, initialMonthsPast=1, initialO
{...this.props} />
}
}
return WithLeaderboardClass;
return WithCurrentLeaderboardClass;
}

const mapDispatchToProps = (dispatch) => bindActionCreators({ fetchLeaderboard, fetchLeaderboardForUser, fetchReviewerLeaderboard }, dispatch)


const WithCurrentLeaderboard = (WrappedComponent) =>
connect(null, mapDispatchToProps)(WithLeaderboard(WrappedComponent))
const WithLeaderboard = (WrappedComponent) =>
connect(null, mapDispatchToProps)(WithCurrentLeaderboard(WrappedComponent))

export default WithLeaderboard

export default WithCurrentLeaderboard

0 comments on commit 678ee4e

Please sign in to comment.