Skip to content

Astronomy support #12

@ochicf

Description

@ochicf

Hi,

first of all I want to thank you for the great package. I've just started using it and it greatly reduced the amount and complexity of the code needed to list documents.

The reason for opening this issue is to ask for Astronomy support, since now it cannot be used because the collection prop type is expected to be an object, but astronomy classes are functions instead (designed to be object constructors). This classes wrap the mongo collection and mantain some of its methods and properties, so I think it may be easy to adapt the package. I don't know which would be the best approach to do so, though.

Just for testing purposes I've forked and modified the following code it ListContainer.jsx:

ListContainer.propTypes = {
  collection: React.PropTypes.oneOfType([
    React.PropTypes.object,
    React.PropTypes.func
  ]).isRequired,
  // rest of prop types
}

Now I can pass an Astronomy Class as the collection prop and the resulting documents are Astronomy docs, so it is working as I'd expect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions