Change actions and addActions to be simpler to use

This commit is contained in:
tannerlinsley
2019-07-23 12:30:15 -06:00
parent e82d2d4b36
commit c7d6562d04
8 changed files with 24 additions and 29 deletions

View File

@@ -7,10 +7,7 @@ import { defaultState } from '../hooks/useTableState'
defaultState.expanded = {}
addActions({
toggleExpanded: '__toggleExpanded__',
useExpanded: '__useExpanded__',
})
addActions('toggleExpanded', 'useExpanded')
const propTypes = {
manualExpandedKey: PropTypes.string,

View File

@@ -7,10 +7,7 @@ import { addActions, actions } from '../actions'
import { defaultState } from '../hooks/useTableState'
defaultState.filters = {}
addActions({
setFilter: '__setFilter__',
setAllFilters: '__setAllFilters__',
})
addActions('setFilter', 'setAllFilters')
const propTypes = {
// General

View File

@@ -13,9 +13,7 @@ import {
defaultState.groupBy = []
addActions({
toggleGroupBy: '__toggleGroupBy__',
})
addActions('toggleGroupBy')
const propTypes = {
// General

View File

@@ -8,10 +8,7 @@ import { defaultState } from '../hooks/useTableState'
defaultState.pageSize = 10
defaultState.pageIndex = 0
addActions({
pageChange: '__pageChange__',
pageSizeChange: '__pageSizeChange__',
})
addActions('pageChange', 'pageSizeChange')
const propTypes = {
// General

View File

@@ -14,9 +14,7 @@ import {
defaultState.sortBy = []
addActions({
sortByChange: '__sortByChange__',
})
addActions('sortByChange')
const propTypes = {
// General