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

Slots iteration helpers #1620

Open
Spone opened this issue Jan 2, 2023 · 5 comments
Open

Slots iteration helpers #1620

Spone opened this issue Jan 2, 2023 · 5 comments
Labels
help wanted slots Related to the Slots feature

Comments

@Spone
Copy link
Collaborator

Spone commented Jan 2, 2023

Feature request

Similar to the iteration context provided when rendering collections, ViewComponent could provide contextual information, such as #size, #index, #first?, and #last?, when rendering slots that have been defined with renders_many.

Motivation

I personally encountered this need at least a dozen times in various projects. This also has been discussed in #545, #982 and #986.

@reeganviljoen
Copy link
Collaborator

@Spone I am trying to get more involved in view component is this possibly an issue I could help with

@Spone
Copy link
Collaborator Author

Spone commented May 9, 2023

@reeganviljoen Yes, you're welcome to start working on this! Let us know if you have questions or if you need help!

@reeganviljoen
Copy link
Collaborator

reeganviljoen commented May 20, 2023

I wrote some failing tests and a component to demonstrate what the itterators will look like #1753

@reeganviljoen
Copy link
Collaborator

@Spone the slot itteration counter helper has been added , I will be adding the iteration context soon

@reeganviljoen
Copy link
Collaborator

@Spone I have fully implemented this feature in #1753
can I ask for you to code review it since you requested this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted slots Related to the Slots feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants