Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Astronomy support #12

Open
ochicf opened this issue Sep 28, 2016 · 2 comments
Open

Astronomy support #12

ochicf opened this issue Sep 28, 2016 · 2 comments

Comments

@ochicf
Copy link

ochicf commented Sep 28, 2016

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.

@SachaG
Copy link
Contributor

SachaG commented Sep 28, 2016

I don't use Astronomy myself so I can't really work on this, sorry… I would accept a PR though.

@ochicf
Copy link
Author

ochicf commented Oct 6, 2016

Created a PR adding support for Astronomy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants