Skip to content

Commit

Permalink
chore: readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
betula committed Jun 4, 2022
1 parent 260f08b commit e32c039
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ At first you have a **state** 😊

```javascript
const $user = box({ email: 'a@x.com' })
const $enabled = box(false)
const $enabled = box(true)
const $counter = box(42)
const $books = box([ 'The Little Prince', 'Alice in Wonderland' ])
```

At second bind **state to React** component!
At second **bind state to React** component!

```javascript
const Books = () => {
Expand Down Expand Up @@ -59,18 +59,22 @@ const BookForm = () => {
At fourth **share your logic** 😉

```javascript
const $loading = box(false)
// ./books.shared.js
export const $books = box([])
export const $loading = box(false)

const load = async () => {
export const load = async () => {
write($loading, true)

const response = await fetch('https://example.com/api/books')
const books = await response.json();
const books = await response.json()

write($books, books)
write($loading, false)
}
```

```javascript
const Books = () => {
const loading = useRe($loading)

Expand All @@ -82,7 +86,7 @@ const Books = () => {
}
```

<hr />


<!-- Perfect code-splitting, pretty and minimalistic syntax, well structured and maintainable codebase. -->

Expand Down Expand Up @@ -363,5 +367,15 @@ console.log(read($next)) // 3
-->


## References

- [Why?]()
- [The dark mode switcher]()
- [Perfect frontend with modular architecture]()
- [Work together with Redux]()

<!--
- [Pure reactivity]()
-->
Enjoy your code!

0 comments on commit e32c039

Please sign in to comment.