Skip to content

Commit c4a5e24

Browse files
committed
Use a truth table
1 parent 7dd1682 commit c4a5e24

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

README.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,14 @@ const CheckoutButton = ({ items, isLoading, checkout }) => {
6666
}
6767
```
6868

69-
If `isLoading` is the active state:
69+
And we can represent our logic and ui as a truth table:
7070

71-
```js
72-
shoppingCart.isDisabled => true
73-
shoppingCart.intent => 'none'
74-
shoppingCart.popover => undefined
75-
```
76-
77-
Similarly, if `isCartEmpty` is the active state:
71+
| | isDisabled | intent | popover |
72+
|------------:|:----------:|:-------:|----------------|
73+
| isLoading | true | none | |
74+
| isCartEmpty | true | error | "Your cart..." |
75+
| isCartValid | false | success | |
7876

79-
```js
80-
shoppingCart.isDisabled => true
81-
shoppingCart.intent => 'error'
82-
shoppingCart.popover => 'Your cart is empty, please add items'
83-
```
8477

8578
## 👩‍🏭 Basic Introduction
8679

0 commit comments

Comments
 (0)