OnChange sets the checkbox's toggle hook. This is the widget's canonical callback surface. Callers that need delayed or asynchronous behavior should build that from this hook so the widget keeps a single stable event path.
(fn ChangeFn)
| 154 | // or asynchronous behavior should build that from this hook so the widget keeps |
| 155 | // a single stable event path. |
| 156 | func OnChange(fn ChangeFn) Option { |
| 157 | return option(func(opts *options) { |
| 158 | opts.onChange = fn |
| 159 | }) |
| 160 | } |