Skip to content

v1.0.0

Compare
Choose a tag to compare
@doniyor2109 doniyor2109 released this 15 Dec 13:51
· 89 commits to master since this release

Initial official release of redux-lightweight 🎉 🎉 🎉

Now we use classes as our base working model for reducers.

You can declare your reducer and its actions in one class like this:

class Counter {
	state = 1

	increment(amount) {
		return this.state + amount
	}
}

Then redux-lightwieght generate actions and reducers for you.

It is basically designed to working with redux.

Support for Hooks

Moreover it has support for hooks which is awesome. Using redux-lightweight with hooks is very easy and it has only one API for that.

function App() {
	const [counter, { increment }] = useUpdater(Counter)

	function handleClick() {
		increment()
	}
	return (
		<>
			{counter}
			<button onClick={handleClick}>Increment</button>
		</>
	)
}