gnim
v1.9.0
Published
Library which brings JSX and reactivity to GNOME JavaScript.
Readme
Gnim
Library which brings JSX and reactivity to GNOME JavaScript.
If you are not already familiar with GJS and GObject, you should read gjs.guide first.
This library provides:
- JSX and reactivity for both Gtk Applications and Gnome extensions
- GObject decorators for a convenient and type safe way for subclassing GObjects
- DBus decorators for a convenient and type safe way for implementing DBus services and proxies.
Obligatory Counter Example
function Counter() {
const [count, setCount] = createState(0)
function increment() {
setCount((v) => v + 1)
}
createEffect(() => {
console.log("count is", count())
})
return (
<Gtk.Box spacing={8}>
<Gtk.Label label={count((c) => c.toString())} />
<Gtk.Button onClicked={increment}>Increment</Gtk.Button>
</Gtk.Box>
)
}