Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Complete switching to buildReferences for examples
  • Loading branch information
prdoyle authored Jul 4, 2023
1 parent b050ea1 commit 7e7708b
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 @@ -130,7 +130,7 @@ To read state, acquire a `ReadContext`:

```
try (var __ = bosk.readContext()) {
System.out.println("Hello, " + bosk.nameRef.value());
System.out.println("Hello, " + bosk.refs.name.value());
}
```

Expand All @@ -141,13 +141,13 @@ It is an antipattern to use many small read contexts during the course of a sing
To modify state, use the `BoskDriver` interface:

```
bosk.driver().submitReplacement(bosk.nameRef, "everybody");
bosk.driver().submitReplacement(bosk.refs.name(), "everybody");
```

During your application's initialization, register a hook to perform an action whenever state changes:

```
bosk.registerHook("Name update", bosk.nameRef, ref -> {
bosk.registerHook("Name update", bosk.refs.name(), ref -> {
System.out.println("Name is now: " + ref.value());
});
```
Expand Down

0 comments on commit 7e7708b

Please sign in to comment.