Skip to content

Releases: doniyor2109/redux-lightweight

1.1.0

26 Dec 05:37
Compare
Choose a tag to compare

v1.1.0

This release contains some performance fixes

Performance

  • Generate actions and reducers once inside useUpdater

v1.0.0

15 Dec 13:51
Compare
Choose a tag to compare

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>
		</>
	)
}