-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Most higher order components allows you to partially apply the options before applying the component, for example recompose, react-redux, react-apollo. This allows you to compose multiple higher order compose like this
export const enhance = compose(
mapProps(({config}) => ({
config,
deviceId: config.deviceId,
interfaceIds,
})),
graphql(gql`
query($deviceId: String!, $interfaceIds: [String!]) {
device(id: $deviceId) {
id
name
interfaceIds
status(interfaceIds: $interfaceIds) {
id
interfaceId
statusId
value
}
}
}
`),
mapProps(props => ({
...props,
status: props.data.device && asObject(props.data.device.status),
})),
)It would be nice if this library supported the same pattern
shanecav, GeKorm and drewlustro