Skip to content

kethan/uwhen-sinuous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UElements

uelements provides a functional way of defining custom elements.

<my-counter count="10"></my-counter>
import { define, useState, o } from "uwhen-sinuous";

function Counter({count}) {
	const value = o(count);

	return (
		<>
			<div>Counter: {value}</div>
			<button onClick={() => value(value() + 1)}>Increment</button>
			<button onClick={() => value(value() - 1)}>Decrement</button>
		</>
	);
}

define("my-counter", {count : 0} (el) => (
	<Counter count={el.count}} />
));

Courtesy: swiss and sinuous

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages