Skip to content
This repository has been archived by the owner on Nov 27, 2022. It is now read-only.

Commit

Permalink
Explain LDflex values better.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Mar 2, 2020
1 parent 372d5ec commit 4594b86
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Expand Up @@ -188,10 +188,14 @@ function ConnectionCount() {
return <span>{`${name}`} is connected to {friends.length} people.</span>;
}
```
Note how we force `name` into a string through `` `${name}` ``
(or, alternatively, `name.toString()` or `'' + name`).
This is needed because LDflex values are special objects
that _look_ like a string, but actually provide extra functionality.
Note how we convert `name` into a string through `` `${name}` ``.
Alternatively, we could also use `name.value`.
We do this because LDflex values
are [terms](https://rdf.js.org/data-model-spec/#term-interface)
rather than strings,
so they can have other properties like `language` and `termType`.
Also, an LDflex value can be used as a path again,
so you can keep on adding properties.

Finally, the `useLDflex` hook also returns status information about the expression.
When its optional second argument is `true`, it returns a list.
Expand Down

0 comments on commit 4594b86

Please sign in to comment.