Guide / 14-Ref

Récapitulatif de l'API

Consultez rapidement l'ensemble des fonctions exposées par les packages virtuels stew/* dans vos scripts <goscript client>.

🚥 stew/state

  • New[T](val T) -> *Signal[T]
  • .Get() -> T
  • .Set(val T)
  • Effect(func())

🧭 stew/nav

  • To(url) // SPA Morphing
  • Back() / Forward() / Reload()
  • Replace(url)
  • StandardTo(url) // Reload

✨ stew/ui

  • Title(txt) / Focus(sel)
  • ScrollTo(sel, smooth)
  • Add / Remove / Toggle / HasClass()
  • Get / SetValue(sel, val)
  • SetStyle(sel, prop, val)

📟 stew/io

  • Alert / Confirm / Prompt
  • Console.Log / Warn / Error
  • Console.Warning (alias)

⌨️ stew/event

  • OnKeyDown / OnKeyUp(key, cb)
  • OnResize(cb) / OnScroll(cb)
  • OnOnline / OnOffline(cb)
  • IsOnline() bool

🎭 stew/anim

  • FadeIn / FadeOut(sel, d)
  • SlideIn(sel, dir, d) / Pulse(sel, d)
  • Shake(sel, d) / Transition(sel, f, t, d)
  • Animate(sel, kf, opt)

🍪 stew/cookies

  • Get(name) / Set(name, val, opts)
  • Delete(name) / Has(name)
  • GetAll() -> map[string]string

💾 stew/storage

  • Local.Get / Set / Remove(key)
  • Session.Get / Set / Remove(key)
  • Clear() / Bind(signal, key)

📦 stew/data

  • URL / Query / Params / Store

🔌 stew/js

  • Bridge API :
  • Run(code) / Global(name)
  • Eval[T](code) / Invoke(fn, args...)
  • Load(url, onLoad) / Unload(url)
  • IsLoaded(url) / Set(name, val)

  • js.Value Methods :
  • .Get(k) / .Set(k, v) / .Call(m, args...)
  • .Invoke(args...) / .String() / .Int()
  • .Bool() / .IsUndefined() / .IsNull()

🌐 stew/net

  • Get / Post / Put[T](url, body)
  • Patch / Delete[T](url, body)
  • Fetch(url, opts) -> (js.Value, err)
  • Watch[T](url, interval) -> *Signal[T]
  • IsLoading // *Signal[bool]

🦴 stew (Core)

  • OnClick(id, handler) / OnEvent
  • GetElement(id) / GetPageData()
  • BindContent / BindInput / BindBlock