Skip to content

Commit

Permalink
documentation is hard
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzypants1989 committed Oct 23, 2023
1 parent ba521c9 commit e976ead
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ declare module "jessquery" {
* el.text(data.message) // All the methods are still available
* })
* .css('color', 'blue')
*
* @example
* const fetchDog = async (el) => {
* const response = await fetch("https://dog.ceo/api/breeds/image/random")
* const data = await response.json()
* el.set("src", data.message)
* }
*
* button.on("click", () => {
* display.html(`<img />`, true).do(fetchDog)
* })
*/
do: (fn: (el: DomProxy<T>) => Promise<void> | void) => DomProxy<T>

Expand Down Expand Up @@ -1418,10 +1429,21 @@ declare module "jessquery" {
* .css('color', 'red')
* .do(async (el) => { // The elements are passed as an argument
* const response = await fetch('/api')
* const data = await response.json()
* el.text(data.message) // All the methods are still available
* const data = await response.json()
* el.text(data.message) // All the methods are still available
* })
* .css('color', 'blue')
*
* @example
*const fetchDog = async (el) => {
* const response = await fetch("https://dog.ceo/api/breeds/image/random")
* const data = await response.json()
* el.set("src", data.message)
* }
*
* buttons.on("click", () => {
* display.html(`<img />`, true).do(fetchDog)
* })
*/
do: (
fn: (el: DomProxyCollection) => Promise<void> | void
Expand Down

0 comments on commit e976ead

Please sign in to comment.