Skip to content

Commit

Permalink
docs: consistenly use Context type
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Jun 18, 2024
1 parent 360486e commit dda70c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ HTML classes, not random combination of query selectors.
```

```js
function MyComponent({ on }) {
function MyComponent({ on }: Context) {
alert(`Hello, I'm ${el.textContext}!`);
}

Expand All @@ -315,7 +315,7 @@ function PubComponent({ on, pub }: Context) {
};
}

function SubComponent({ on, sub }) {
function SubComponent({ on, sub }: Context) {
sub(EVENT); // This adds sub:my-event class to the mounted element, which means it subscribes to that event.

on[EVENT] = () => {
Expand Down

0 comments on commit dda70c3

Please sign in to comment.