Document swapFunctions of astro:transitions/client#9084
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
I'm wondering whether we should have a nice API entry for Since it's something we import from |
Yes, definitively. It could be part of #7961! But i would not add it to the API section before the events. You use the custom swap functions to redefine the swap function of the event object. |
sarah11918
left a comment
There was a problem hiding this comment.
OK, so I am now really feeling the lack of a section in API reference for astro:transitions 😄 But for now, for this addition, I think we can do this, then separately let's get a new section in the API reference page and we'll come back here and link to a proper full reference of all these things!
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
|
Thank you very much for your help Sarah! There is a reason why Astro Docs have such a good reputation 💜 |
sarah11918
left a comment
There was a problem hiding this comment.
Thanks for the helpful polish on this, @martrapp ! Approving for docs! (Wait, this is docs...)
| }; | ||
|
|
||
| ... | ||
| ev.swap = () => mySwap(ev.newDocument); |
There was a problem hiding this comment.
| ev.swap = () => mySwap(ev.newDocument); | |
| event.swap = () => mySwap(event.newDocument); |
Last tiny tiny thing: assuming that ev stands for event, we generally prefer to write these words out in full as they can help people who aren't used to standard abbreviations. This would be my preference, if correct!
There was a problem hiding this comment.
Good one! I had used ev for consistency with the rest of the page. Now everything is consistent again ;-)
yanthomasdev
left a comment
There was a problem hiding this comment.
LGTM @martrapp, good work! 💜
Description (required)
In 4.8.0 10908 we introduced building blocks for custom swap() functions. Up to now we didn't properly document and export them. We first wanted to see if they worked. They did.
This PR is intended to discuss and close this technical debt.
For Astro version:
4.15.0. See astro PR 11708.