## Summary
Adds a counter example that demonstrates the core signals-based reactivity model.
## Changes
- Added `examples/counter/main.go` showing:
- Creating a signal with `reactive.NewSignal(0)`
- Reading with `count.Get()`
- Writing with `count.Set(count.Get() + 1)`
- Button click handler that increments the count
- Reactive text that updates automatically when the signal changes
Closes #4
Basic example showing:
- Creating a signal with NewSignal
- Reading value with Get()
- Writing value with Set()
- Button click handler
- Reactive text that updates when signal changes
Closes#4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clean, minimal example demonstrating the Iris reactive signals pattern.
Feedback
The example is well-structured but missing the decrement button mentioned in the original issue #4. The issue requested:
Creating a signal
Reading with Get()
Writing with Set()
Button click handler
Reactive text update
A decrement button would make the example more complete and better demonstrate the reactive updates when the value changes in either direction.
Suggested change
Add a decrement button alongside the increment:
// Button that decrements the count on clickview.Child(ui.Button(func(){count.Set(count.Get()-1)},ui.TextFromString("Decrement")))
Please add the decrement button before merging.
## Code Review
### Summary
Clean, minimal example demonstrating the Iris reactive signals pattern.
### Feedback
The example is well-structured but missing the **decrement button** mentioned in the original issue #4. The issue requested:
- Creating a signal
- Reading with Get()
- Writing with Set()
- Button click handler
- Reactive text update
A decrement button would make the example more complete and better demonstrate the reactive updates when the value changes in either direction.
### Suggested change
Add a decrement button alongside the increment:
```go
// Button that decrements the count on click
view.Child(ui.Button(func() {
count.Set(count.Get() - 1)
}, ui.TextFromString("Decrement")))
```
Please add the decrement button before merging.
Address review feedback to include a decrement button that
demonstrates reactive updates in both directions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Clean, minimal example demonstrating the Iris reactive signals pattern.
Highlights
Proper WASM build tag
Clear signal creation with reactive.NewSignal(0)
Reactive text using ui.TextFromFunction that auto-updates
Both increment and decrement buttons demonstrating Set/Get pattern
Previous Feedback
Decrement button has been added as requested.
LGTM - merging.
## Code Review - Approved
Clean, minimal example demonstrating the Iris reactive signals pattern.
### Highlights
- Proper WASM build tag
- Clear signal creation with `reactive.NewSignal(0)`
- Reactive text using `ui.TextFromFunction` that auto-updates
- Both increment and decrement buttons demonstrating Set/Get pattern
### Previous Feedback
Decrement button has been added as requested.
LGTM - merging.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Adds a counter example that demonstrates the core signals-based reactivity model.
Changes
examples/counter/main.goshowing:reactive.NewSignal(0)count.Get()count.Set(count.Get() + 1)Closes #4
Code Review
Summary
Clean, minimal example demonstrating the Iris reactive signals pattern.
Feedback
The example is well-structured but missing the decrement button mentioned in the original issue #4. The issue requested:
A decrement button would make the example more complete and better demonstrate the reactive updates when the value changes in either direction.
Suggested change
Add a decrement button alongside the increment:
Please add the decrement button before merging.
Code Review - Approved
Clean, minimal example demonstrating the Iris reactive signals pattern.
Highlights
reactive.NewSignal(0)ui.TextFromFunctionthat auto-updatesPrevious Feedback
Decrement button has been added as requested.
LGTM - merging.