Skip to content

Commit

Permalink
Add quick start example
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Apr 12, 2024
1 parent 5156f20 commit 5f828d7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/reactivity-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@
## Quick Example

```ts
import { reactive, computed, watch } from "@conterra/reactivity-core";

const firstName = reactive("John");
const lastName = reactive("Doe");
const fullName = computed(() => `${firstName.value} ${lastName.value}`);

watch(
() => [fullName.value],
([fullName]) => {
console.log(fullName);
},
{
immediate: true
}
);

firstName.value = "Jane";
```

## Usage
Expand Down

0 comments on commit 5f828d7

Please sign in to comment.