Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const mapDispatchToProps = { storeUser, createUser, updateUser }
const mapPropsToQuery = function(props) {
if (props.initialValues) return
return {
url: `/api/users/${props.id}`,
transform: props.storeUser,
update: {} // Disregard redux-query update methods
}
}
const enhance = compose(
connect(mapStateToProps, mapDispatchToProps),
connectRequest(mapPropsToQuery)
)
UserFormContext = enhance(UserFormContext)
export default UserFormContext
users: getUserListPage(state, currentPage),
isReady: isUserListReady(state)
}
}
const mapDispatchToProps = { storeUsers, setPageNumber }
const mapPropsToQuery = (props) => ({
url: `/api/user/list?page=${props.currentPage}`,
transform: props.storeUsers,
update: {} // Disregard redux-query update methods
})
const enhance = compose(
connect(mapStateToProps, mapDispatchToProps),
connectRequest(mapPropsToQuery)
)
UsersListContext = enhance(UsersListContext)
export default UsersListContext