What I Built (In Plain English)

Managing shared state across a React application used to require endless Redux boilerplate: action types, action creators, reducers, thunk middleware, and complex store wiring.

I built kiss-react-state—a zero-boilerplate state management library for React. It replaces sprawling Redux directories with a clean, hook-based API that lets developers read store state and dispatch typed actions in a single line of code.

KISS React State Architecture

⚠️ Tech Ahead: The sections below explore the custom React Hooks architecture, unidirectional data dispatcher, typed payloads, and async thunk handling.


Architectural Comparison: KISS vs. Redux

Feature kiss-react-state Traditional Redux
Boilerplate Zero (direct hook invocation) Extensive (actions, reducers, types)
Store Connection Automatic via custom hook <Provider> wrapping + connect() / selectors
Async Operations Native inline process/thunk actions Requires redux-thunk or redux-saga
Bundle Impact Ultra-lightweight (<2KB) Heavier dependency chain

Technical Mechanics

1. Direct Hook Access

Instead of mapping state to props or creating complex selector trees, components subscribe to state slices directly:

import { useStoreState, useStoreActions } from 'kiss-react-state';

export function UserProfile() {
  const user = useStoreState((state) => state.currentUser);
  const { updateUser, fetchUserData } = useStoreActions();

  return (
    <div>
      <h1>{user.name}</h1>
      <button onClick={() => fetchUserData(user.id)}>Refresh</button>
    </div>
  );
}

2. Unidirectional Action Dispatcher

The internal store maintains an immutable single source of truth:

  • Simple Actions: Synchronous state transitions with typed payloads.
  • Process Actions: Asynchronous flows (thunks) that yield intermediate loading states without external middleware libraries.
— [ DISPATCH TRANSMISSION COMPLETE // END OF FILE ] —
NR

Nuno Ribeiro

Head of Cloud, Full Stack developer (C++, Rust, TypeScript), and digital artist. Writing on distributed architectures, low-latency execution pipelines, and automated intelligence.