effect value returns T instead of string
This commit is contained in:
parent
16c3a01d2b
commit
dab0b9f59b
@ -1,7 +1,5 @@
|
||||
package naive
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Effect[T any] struct {
|
||||
value T
|
||||
listeners []func(newValue T)
|
||||
@ -21,8 +19,8 @@ func UseEffect[T any](value T) *Effect[T] {
|
||||
return eff
|
||||
}
|
||||
|
||||
func (eff *Effect[T]) Value() string {
|
||||
return fmt.Sprintf("%v", eff.value)
|
||||
func (eff *Effect[T]) Value() T {
|
||||
return eff.value
|
||||
}
|
||||
|
||||
func (eff *Effect[T]) SetValue(newValue T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user