Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default sort support #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

calebsoper
Copy link

@calebsoper calebsoper commented Aug 3, 2018

#29

@calebsoper calebsoper changed the title add default sort support #29 add default sort support Aug 3, 2018
}
}

props.definition.filter(filterSort)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user sort here instead:

const sort = (a, b) => {
if (a.sort < b.sort) return a
if (a.sort > b.sort) return b
return 0
}
const sorted = [...props.definition]
sorted.sort(sort)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take another look into this, but I initially did a sort similar to this and it resorted the columns as opposed to the data within the columns :/

}
}

const enhance = compose(
connect(mapStateToProps, mapDispatchToProps),
lifecycle(lifecycleHandlers),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be triggering a new refresh for this, this logic should instead just update the initial state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants