TimDaub/preact-nominal-allocator

Extra nesting of `decrement` and `increment` may be unnecessary

Closed this issue · 4 comments

See this line:

<button type="button" onClick="${() => decrement()}" value="-" />

I think it should be possible to just do:

<button type="button" onClick="${decrement}" value="-" />

if I do it like that than its called in a loop immediately counts down to 0 without a button click

ah yes can be., my bad. Ok closing.

@FabiDau are you sure you didn't do decrement() because that'd cause a loop whereas decrement shouldn't

hm not sure cant see a difference between ${decrement} ||| ${() => decrement()} works both without loop. I changed it now to ${decrement}