Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nolimitstore

nolimitclinton212ISC0.0.3TypeScript support: included

A lightweight Redux-like store for React and React Native, with hooks and selector support. Built with TypeScript, no boilerplate, and full reactivity via useSyncExternalStore.

react, react-native, state, store, state-management, redux-alternative, useSyncExternalStore, useStore, useDispatch, hooks, typescript, lightweight-redux, zustand-alternative, global-state, react-context

readme

🔗 nolimitstore

A lightweight, Redux-like global state manager for React and React Native apps.
Built with TypeScript, powered by hooks, and optimized with useSyncExternalStore.


🚀 Features

  • ✅ No boilerplate — create a store in one line
  • 🎯 Select only the state you need with useStore
  • 🔁 Built-in useDispatch for updates
  • 📦 React + React Native compatible
  • 🧠 Written in TypeScript with full type safety
  • 🪶 Tiny and fast

📦 Installation

npm install nolimitstore

⚡ Quick Start

Step 1: Create your store

import { createStore } from 'nolimitstore';

type AppState = {
  name: string;
  age: number;
};

const store = createStore<AppState>(
  { name: 'Clinton', age: 0 },
  (state, action) => {
    switch (action.type) {
      case 'incremented_age':
        return { ...state, age: state.age + 1 };
      case 'changed_name':
        return { ...state, name: action.nextName };
      default:
        throw new Error('Unknown action: ' + action.type);
    }
  }
);

Step 2: Wrap your app in StoreProvider

import { StoreProvider } from 'nolimitstore';

function App() {
  return (
    <StoreProvider store={store}>
      <YourAppComponents />
    </StoreProvider>
  );
}

Step 3: Use in any component

import { useStore, useDispatch } from 'nolimitstore';

function Profile() {
  const name = useStore(s => s.name);
  const age = useStore(s => s.age);
  const dispatch = useDispatch();

  return (
    <>
      <Text>{name}</Text>
      <Text>{age}</Text>
      <Button onPress={() => dispatch({ type: 'incremented_age' })} title="Add Age" />
      <Button onPress={() => dispatch({ type: 'changed_name', nextName: 'Essence' })} title="Change Name" />
    </>
  );
}

🔍 API Reference

createStore(initialState, reducer)

Creates the global store.

<StoreProvider store={store}>

Wraps your app to provide context.

useStore(selector)

Access part of the state with a selector.

useDispatch()

Returns the dispatch function to send actions.

🛠 Tech Stack

•    React 18+
•    useSyncExternalStore
•    TypeScript
•    Context API (no external dependencies)

📄 License

MIT License

👩🏾‍💻 Author

Created by Clinton Onuoha