MCPcopy Index your code
hub / github.com/activejs/activejs

github.com/activejs/activejs @0.2.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.3 ↗ · + Follow
550 symbols 1,332 edges 91 files 185 documented · 34%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<a href="https://activejs.dev">
    <img width="700px" src="https://raw.githubusercontent.com/activejs/static/master/AJS%20Logo%20Full%20-%20Banner.svg"/>
</a>



<b>Pragmatic, Reactive State Management for JavaScript Apps</b>




<a aria-label="MIT license" href="https://github.com/activejs/activejs/blob/master/LICENSE">
    <img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&color=0169FF&labelColor=000">
</a>
<a aria-label="npm version" href="https://www.npmjs.com/package/@activejs/core">
    <img src="https://img.shields.io/npm/v/@activejs/core?style=flat-square&color=0169FF&labelColor=000">
</a>
<a aria-label="Discord chat" href="https://discord.gg/M8r9gcEDR6">
    <img src="https://img.shields.io/badge/chat-discord-blue.svg?style=flat-square&color=0169FF&labelColor=000">
</a>
<a aria-label="PRs welcome" href="http://makeapullrequest.com">
    <img src="https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat-square&color=0169FF&labelColor=000">
</a>

```shell script npm i @activejs/core


### 🚀 [Get Started](https://docs.activejs.dev/intro/getting-started)

### 📖 [Documentation](https://docs.activejs.dev)

### 🤾 [Playground](https://activejs.dev/#/playground)

### 📑 [TodoMVC Example](https://activejs.dev/#/examples/todomvc)

### ⚡ Quick Example

This is how an implementation of a simple **counter** looks like, using a
[NumUnit](https://docs.activejs.dev/fundamentals/units/numunit), one of
the reactive data structures that ActiveJS provides. The NumUnit stores
and provides a `number` value at all times ensuring the **type-safety**.

```typescript
// initialize a reactive data structure to store numbers
const counter = new NumUnit(); // with default initial-value 0

// two pure functions to produce an appropriate new value
const increment = value => value + 1;
const decrement = value => value - 1;

// subscribe for reactive value access, and log the value
counter.subscribe(value => console.log(value));
// immediately logs 0, and will log any future values

// increment
counter.dispatch(increment); // you'll see 1 in the console
// the pure function is called with the current value and
// the returned value is dispatched automatically

// decrement
counter.dispatch(decrement); // you'll see 0 in the console
// that's it our counter is complete

// you can also access the value directly
console.log(counter.value()); // logs 0

📊 Quick Comparisons

<b>A simple "counter" implemented in Redux vs ActiveJS.</b>




<img width="680px" src="https://raw.githubusercontent.com/activejs/static/master/Redux%20vs%20ActiveJS.png"/>





<b>A simple "counter" implemented in NgRx vs ActiveJS.</b>




<img width="680px" src="https://raw.githubusercontent.com/activejs/static/master/NgRx%20vs%20ActiveJS.png">

🤝 Contributing

We welcome all contributions, whether you're reporting an issue, helping us fix bugs, improve the docs, or spread the word. We also welcome your suggestions and feedback.

⚖ Licence

MIT

💻 Author

Ankit Singh

Extension points exported contracts — how you extend this code

ListUnit (Interface)
(no doc)
packages/core/src/lib/list-unit.ts
AppEnvironment (Interface)
(no doc)
projects/ajs/src/environments/environment.base.ts
StringUnit (Interface)
(no doc)
packages/core/src/lib/string-unit.ts
FormattedItem (Interface)
(no doc)
projects/ajs/src/app/modules/examples/typeahead/typeahead.component.ts
NumUnit (Interface)
(no doc)
packages/core/src/lib/num-unit.ts
Matchers (Interface)
(no doc)
packages/core/src/tests/immutability.spec.ts
BaseConfig (Interface)
(no doc)
packages/core/src/models/base.ts

Core symbols most depended-on inside this repo

dispatch
called by 98
packages/core/src/lib/action.ts
randomBoolean
called by 81
packages/core/src/tests/utils.ts
randomValue
called by 73
packages/core/src/tests/utils.ts
selectRandom
called by 72
packages/core/src/tests/utils.ts
subscribe
called by 63
packages/core/src/lib/stream.ts
randomNumber
called by 59
packages/core/src/tests/utils.ts
randomValidValue
called by 52
packages/core/src/tests/utils.ts
reset
called by 39
packages/core/src/lib/configuration.ts

Shape

Method 222
Function 155
Class 149
Interface 22
Enum 2

Languages

TypeScript100%

Modules by API surface

packages/core/src/models/events.ts77 symbols
packages/core/src/tests/utils.ts46 symbols
packages/core/src/lib/abstract-unit-base.ts45 symbols
packages/core/src/lib/list-unit.ts33 symbols
packages/core/src/utils/funcs.ts24 symbols
packages/core/src/lib/dict-unit.ts18 symbols
packages/core/src/lib/configuration.ts18 symbols
packages/core/src/lib/async-system-base.ts17 symbols
packages/core/src/lib/cluster.ts14 symbols
packages/core/src/lib/abstract-base.ts13 symbols
packages/core/src/lib/string-unit.ts11 symbols
projects/ajs/src/app/modules/examples/todomvc/todo.service.ts10 symbols

For agents

$ claude mcp add activejs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact