1.0.0 • Published 2 years ago

quark-store v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Quark Store

A tiny state manager for React. It uses many quark stores and direct manipulation.

Small. Between 216 bytes (minified and gzipped). Zero dependencies. It uses Size Limit to control size.

  • Fast. With small createStore and derived stores, you do not need to call the selector function for all components on every store change.
  • Tree Shakable. A chunk contains only stores used by components in the chunk.
  • Designed to move logic from components to stores.
  • Good TypeScript support.
// store/todos.ts
import { createStore } from 'quark-store';

export const $todos = createStore<Todo[]>([]);

export function addTodo(todo: Todo) {
	$todos.set([...$todos.get(), todo]);
}
import { createStore, useStore } from 'quark-store';

const $todos = createStore<Todo[]>([]);

export const Todos = () => {
	return (
		<>
			<div>
				{todos.map(todo => (
					<div key={todo.id}>{todo.label}</div>
				))}
			</div>
		</>
	);
};
1.0.0

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago