Skip to content

Commit

Permalink
fix: remove redundand function arg for rerender
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejcodes committed Jul 12, 2023
1 parent 1c9e239 commit f3e7682
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/api/minze-element.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ export class MyElement extends MinzeElement {

## rerender <Badge type="tip" text="^1.0.0" />

Requests a component re-render. The current template will be compared to the cached template and if they are different, the component will be rerendered. If you want to force-rerender, without any checks, pass `true` as the first argument.
Requests a component re-render, invalidating all caches.

- **Method**

- **Type:** `(force?: boolean): void`
- **Type:** `(): void`

- **Example:**

Expand All @@ -433,7 +433,7 @@ export class MyElement extends MinzeElement {
`

onReady() {
this.rerender(true)
this.rerender()
}
}
```
Expand Down
8 changes: 3 additions & 5 deletions packages/minze/src/lib/minze-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,15 @@ export class MinzeElement extends HTMLElement {
}

/**
* Re-renders the component template.
*
* @param force - Forces the re-rendering of the template regardless of caching.
* Re-renders the component template, invalidating all caches.
*
* @example
* ```
* this.rerender()
* ```
*/
rerender(force?: boolean) {
this.render(force)
rerender() {
this.render(true)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class MinzeReactivePatch extends MinzeElement {
}

handleClick = () => {
this.rerender(true)
this.rerender()
}

eventListeners: EventListeners = [
Expand Down

0 comments on commit f3e7682

Please sign in to comment.