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

Suggestion: return array of strings after transform #9

Closed
hlozancic opened this issue Mar 16, 2018 · 4 comments
Closed

Suggestion: return array of strings after transform #9

hlozancic opened this issue Mar 16, 2018 · 4 comments
Labels
enhancement New feature or request

Comments

@hlozancic
Copy link

For example I have TagTransformer which should return tags as array of tag.title strings like:
tags: ['tag1', 'tag2', 'tag3' ... ]

Currently it's only possible to return array of tag objects like:
tags: [{title: 'tag1'}, {title: 'tag2'}, {title: 'tag3'} ...]

@rhwilr
Copy link
Owner

rhwilr commented Mar 16, 2018

If this is in an include function you can just return an array from there instead of using the collection method.
But i will check what it would take to allow a transformer to return arrays and primitive types.

@rhwilr rhwilr added the enhancement New feature or request label Mar 16, 2018
@rhwilr
Copy link
Owner

rhwilr commented Mar 17, 2018

@hlozancic I just made made a small change to allow a transformer to return primitive types. Would be awesome if you could check it out by installing from master (a173997) and give feedback if this satisfies your needs.

@hlozancic
Copy link
Author

hlozancic commented Mar 18, 2018

Yeah! That's it :)

👍

It works for .item and .collection as expected!

@rhwilr
Copy link
Owner

rhwilr commented Mar 18, 2018

Is available in v1.1.0

@rhwilr rhwilr closed this as completed Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants