Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
anticultist committed Apr 12, 2024
1 parent 5e7da46 commit 7d0deed
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/reactivity-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ import { reactive, computed } from "@conterra/reactivity-core";
// In this example, first name and last name can only be written to.
// Only the combined full name is available to users of the class.
class Person {
_firstName = reactive("");
_lastName = reactive("");
_firstName = reactive("John");
_lastName = reactive("Doe");
_fullName = computed(() => `${this._firstName.value} ${this._lastName.value}`);

setFirstName(name) {
setFirstName(name: string) {
this._firstName.value = name;
}

setLastName(name) {
setLastName(name: string) {
this._lastName.value = name;
}

Expand Down Expand Up @@ -264,7 +264,7 @@ This package provides a set of collection classes to simplify working with compl

#### Array

The `ReactiveArray<T>` behaves largely like a normal `Array<T>`.
The `ReactiveArray<T>` behaves largely like a normal [`Array<T>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
Most standard methods have been reimplemented with support for reactivity (new methods can be added on demand).

The only major difference is that one cannot use the `[]` operator.
Expand All @@ -291,7 +291,7 @@ array.set(0, 123); // effect prints 123

#### Set

The `ReactiveSet<T>` can be used as substitute for the standard `Set<T>`.
The `ReactiveSet<T>` can be used as substitute for the standard [`Set<T>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set).

Example:

Expand All @@ -311,7 +311,7 @@ set.add(123); // effect prints 1

#### Map

The `ReactiveMap<T>` can be used as a substitute for the standard `Map<T>`.
The `ReactiveMap<T>` can be used as a substitute for the standard [`Map<T>`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map).

Example:

Expand Down

0 comments on commit 7d0deed

Please sign in to comment.