Skip to content

tishlang/lattish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lattish

Lattish runtime for Tish JSX — hooks + DOM helpers for compiled Tish apps.

Install

npm install lattish
# or
npm install @tishlang/lattish

Usage

import { useState, createRoot, h, Fragment } from 'lattish'

fn App() {
  let [count, setCount] = useState(0)
  return <div>
    <p>{"Count: " + String(count)}</p>
    <button onclick={() => setCount(count + 1)}>{"Increment"}</button>
  </div>
}

createRoot(document.getElementById("root")).render(App)

Requires the Tish compiler with --jsx lattish (default) and node_modules resolution for bare specifiers. The compiler lowers JSX to calls that Lattish provides.

Exports

  • h, Fragment, text — DOM runtime for compiled JSX
  • createRoot — mount and re-render
  • useState, useRef, useMemo, useEffect, useLayoutEffect — hooks (DOM event handlers batch updates automatically)

Examples

  • Tishexamples/features/ (requires tish compiler)
  • JS/TSexamples/js-workflow/ (no tish; imports compiled lattish)

Links

About

JSX + React-like micro framework for tish

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors