Documentation for complete API
See original GitHub issueI took a look at the source code and found that there might be more “features” than are visible in the current documentation on the website. I wondered if this information is omitted accidentally or willingly. For example, functions like getControllerForElementAndIdentifier
on the application object which can be quite handy if one knows that it exists.
Any plans to extend the documentation for a full reference of all available functions?
Also, side-note, it would be nice if the functions featured JSDoc comments so that the reference for IDEs and code editors supporting JSDoc can show this additional information. Or at least the generated d.ts
files would already be an improvement.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Write API Documentation: Best Practices and Examples
Today we will talk about how to foster positive developer experience in the API documentation. But first, we need to understand what makes ......
Read more >What Is API Documentation? [+ How to Write and Read It]
API documentation is essentially an instruction manual that explains how to use an API and its services. This manual might contain tutorials, ...
Read more >Documenting APIs: A guide for technical writers and engineers
In this course on writing documentation for APIs, instead of just talking ... on metrics and measurement, which lists a comprehensive quality checklist....
Read more >The 8 Best API Documentation Examples for 2022
Learn documentation best practice from these great API ... Generate a full-featured,documented, and secure REST API in minutes.
Read more >How to Write Good API Documentation - freeCodeCamp
Moving on – so what is API documentation? Well, it's a written guide stating the functions of the API, how to integrate it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey gang, it’s true that there’s a lot of “missing manual” around Stimulus.
The best way to learn advanced Stimulus techniques IMHO is to read the source of projects like stimulus-use and StimulusReflex. The SR client is likely the most sophisticated Stimulus controller, today.
@julianrubisch has done a heroic job of compiling a lot of the missing concepts on https://betterstimulus.com (as linked by @lordcysiek above) but there’s always more and we’re still discovering new patterns all of the time.
New patterns is my segue to the issue of controller-to-controller communication! When I proposed the
this.element['foo'] = this
binding technique, I didn’t intend that it was for controllers that are connected to the same DOM element, at all.You can talk across
this.element
, but the goal is to access controllers on elements elsewhere in the DOM that you have a reference to, usually viaid
query. You might have a<div id="content" data-controller="content"></div>
that is conceptually important in your application; you also have components anywhere on the page that need to access the internal state of thecontent
controller instance. This is an intentional set of design decisions which allow you to build-up functionality.Raising and listening for custom events should be the first tool you reach for when you need to communicate between Stimulus controllers. One of the “missing manual” concepts is how most of what people put in their
connect
should actually be ininitialize
, leavingconnect
anddisconnect
almost exclusively to set upaddEventListener
/removeEventListener
pairs.However, event dispatch is passive and asyncronous; you’re working in callbacks. There are times where you need to reach into a controller and access its internal state - whether to inspect a variable or execute a method - from your current scope right now… and that’s what hanging
this
on a variable on an element is for.Feel free to turn any of these discussions into doc PRs for consideration.