Nucleux

Nucleux

2 10 14
calendar_todayschedule1 min read

The Story Behind Nucleux

Nucleux emerged from a simple frustration: existing React state management solutions either require complex provider setups (like Context API) or cause unnecessary re-renders (like most global state libraries). After trying Redux, Zustand, Jotai, and building custom solutions, I realized developers needed something that combined atomic precision with organizational clarity.

How It Works

Nucleux uses atomic state management where each piece of state is independent. When you update an atom, only components subscribed to that specific atom re-render - no cascade effects, no provider hell.

class TodoStore extends Store {
  todos = this.atom([])
  filter = this.atom('all')
  
  addTodo(text) {
    this.todos.value = [...this.todos.value, { id: Date.now(), text }]
  }
}
function TodoApp() {
  const todoStore = useStore(TodoStore)
  const todos = useValue(todoStore.todos)
  
  return (
    <div>
      <button onClick={() => todoStore.addTodo('New task')}>
        Add Todo
      </button>
      <ul>
        {todos.map(todo => (
          <li key={todo.id}>{todo.text}</li>
        ))}
      </ul>
    </div>
  )
}

Key Features

  • Zero Providers: Use state anywhere without wrapping components
  • Atomic Updates: Only subscribed components re-render
  • Organized Architecture: Class-based stores group related state and methods
  • Built-in Persistence: Save to localStorage/AsyncStorage automatically
  • Dependency Injection: Stores can easily depend on other stores
  • Lightweight: Only 3.5KB gzipped
  • SSR Compatible: Works seamlessly with Next.js and server-side rendering

Three Powerful Hooks

  1. useStore(StoreClass) - Access store methods
const todoStore = useStore(TodoStore)
todoStore.addTodo('New task')
  1. useValue(atom | StoreClass, 'atomKey') - Subscribe to specific atoms
const todos = useValue(todoStore.todos)
// or
const todos = useValue(TodoStore, 'todos')
  1. useNucleux(StoreClass) - Get everything at once
const { todos, filter, addTodo } = useNucleux(TodoStore)

Get Involved

  • Try it: npm install nucleux or check the live demo
  • Contribute: Visit GitHub for issues and feature requests
  • Documentation: Full guides at nucleux.dev

We're looking for contributors who understand React performance, state management patterns, and developer experience. Whether it's bug fixes, new features, or documentation improvements - all contributions are welcome!

2 Comments

0 votes
0 votes
🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

How Layered Memoization in Nucleux v1.3.0 Eliminates React's Biggest Performance Pitfall

MartyRoque - Jun 23, 2025

The Role of State Management in Building Scalable Front-End Applications

Alex Mirankov - Nov 24, 2024

Building Scalable React Native Apps with Nucleux and Supabase

MartyRoque - Jul 14, 2025

The Code You Ship Today Will Be Read By Someone Who Wasn't In The Room

Artem Trukhanoff - Jun 21

Mastering Redux Toolkit By Building A Shopping Cart

lawrenceagles - Nov 19, 2025
chevron_left
1k Points26 Badges
4Posts
5Comments
I'm a software developer who loves philosophy, personal development, and metal music. I love building stuff that pushes the boundaries of technology.

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!