0.0.8 • Published 1 year ago

x-shard-react v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

x-shard

GitHub

React bindings for x-shard.

yarn add x-shard-react

Showcase

import { createEvent, createStore } from 'x-shard';
import { useStore } from 'x-shard-react';

const $main = createStore({ counter: 5 });
const incremented = createEvent();

$main.on(incremented, (store) => {
	store.counter += 1;
});
$main.on('document:DOMContentLoaded', (store) => {
	store.counter += 10;
});

function App() {
	const $ = useStore($main);

	return (
		<button onClick={() => incremented()}>count is {$.counter}</button>
	);
}
0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago