@react-mini/redux
v1.0.30
Published
Implements the most basic functionality of react-redux with a bundle size of 6.1 kB.
Downloads
1
Readme
Implements the most basic functionality of react-redux with a bundle size of 5.24kB.
Components to use:
Example:
import React, { useState } from "react";
import { onStoreChanged,updateState } from "@react-mini/redux";
export const Home = () => {
const propertyName = "buttonClick";
const [buttonState, setButtonState] = useState(false);
onStoreChanged({
propertyName,
callback: (data) => setButtonState(data),
});
return (
<div>
<input
type="button"
onClick={() =>
updateState({
value: !buttonState,
propertyName,
})
}
value={`${buttonState}`}
></input>
</div>
);
};