import create from 'xoid'
import React from 'react'
const App = ($props, { effect, read }) => {
const $count = create(0)
const increment = () => $count.update(state => state + 1)
// conditionally callable context reader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const htmlTag = document.querySelector('html') | |
const checkDarkMode = () => htmlTag.hasAttribute('dark') | |
const watchDarkMode = (onChange) => { | |
let isDark, isDarkBefore | |
isDark = checkDarkMode() | |
onChange(isDark) | |
const observer = new MutationObserver(mutations => { | |
mutations.forEach(mutation => { |
OlderNewer