Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Aug 22, 2021
1 parent 3d01786 commit 21d4cc2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,19 @@ import { reactive, on, createValue } from "@vzn/reactivity";

const [getName, setName] = createValue("Hello");

reactive(on(getName, (v) => console.log('Name has changed!')));
reactive(on(getName, (v) => console.log("Name has changed!")));

// is equivalent to:
reactive(() => {
getName();
freeze(() => console.log('Name has changed!'));
freeze(() => console.log("Name has changed!"));
});
```

You can also not run the reaction immediately and instead opt in for it to only run on change by setting the defer option to true.

```js
reactive(on(getName, (v) => console.log('Name has changed!'), true));
reactive(on(getName, (v) => console.log("Name has changed!"), true));
```

# TO DO
Expand Down

0 comments on commit 21d4cc2

Please sign in to comment.