Skip to content

Allow applyContainerQuery to work as a curried function #60

@Pajn

Description

@Pajn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions