Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
t-miller committed Jul 5, 2023
1 parent 776b817 commit ca5755e
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ If the parent store is nullable, then the child store will also be nullable.

```ts
type User = {
name: {
first: string;
last: string;
};
relations: {
partner?: User;
};
name: {
first: string;
last: string;
};
relations: {
partner?: User;
};
};

const maybeUser = writable<User | undefined>(undefined);
Expand Down Expand Up @@ -152,14 +152,14 @@ One important method to reduce clutter on your component is to extract functiona

```js
export const trackClicks = (node, clicks) => {
const listen = () => {
clicks.update(($clicks) => $clicks + 1);
};
node.addEventListener('click', listen);
return {
destroy() {
node.removeEventListener('click', listen);
},
};
const listen = () => {
clicks.update(($clicks) => $clicks + 1);
};
node.addEventListener('click', listen);
return {
destroy() {
node.removeEventListener('click', listen);
},
};
};
```

0 comments on commit ca5755e

Please sign in to comment.