inline-connect
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

#Installation

yarn add inline-connect

#Example

const App = () => {
  const fields = useSelector((state: State) => state.Component1.fields);
  const dispatch = useDispatch();
  return (
    <div className="App">
      {fields.map((str, index) => {
        return (
          <Connected
            selectors={[(state: State) => state.Component1.fields[index]]}
            actions={[
              (e: any) =>
                dispatch({ type: "SET_FIELD", index, value: e.target.value })
            ]}
          >
            {str => log => {
              return <input value={str} onChange={log} />;
            }}
          </Connected>
        );
      })}
    </div>
  );
};

/inline-connect/

    Package Sidebar

    Install

    npm i inline-connect

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    82.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • humflelump