Skip to content

obsidian/ToggleComponent

Mock of Obsidian’s ToggleComponent, an on/off switch.

Class Description
ToggleComponent Mock of Obsidian’s ToggleComponent. The on/off state is kept in ToggleComponent.on. As in Obsidian, ToggleComponent.setValue calls the change callback only when the value actually changes, and ToggleComponent.onClick flips the toggle unless it is disabled.