Ego - Devlog

Raffy Efrényi

Raffy Efrényi

@Raffy27a

??? I have a basic idea of the functionality that I need and the topics that I still need to learn about 21-03-2022 Learning about context driven patterns in Go

useTheme.ts
import { ref, watchEffect } from 'vue'

type Theme = 'light' | 'dark' | 'system'

const theme = ref<Theme>('system')

export function useTheme() {
  const setTheme = (value: Theme) => {
    theme.value = value
    localStorage.setItem('theme', value)
  }

  watchEffect(() => {
    const root = document.documentElement
    root.classList.toggle('dark', theme.value === 'dark')
  })

  return { theme, setTheme }
}
package main
 
import (
    "log"
    "net/http"
)
 
func main() {
    mux := http.NewServeMux()
    mux.HandleFunc("/health", healthCheck)
 
    log.Println("listening on :8080")
    if err := http.ListenAndServe(":8080", mux); err != nil {
        log.Fatal(err)
    }
}
Terminal
$ acme deploy --env production
> built 42 modules
> deployed to https://api.acme.dev

Leave a comment

Comments

No comments yet. Be the first one?