
Security News
Microsoft Releases Open Source Toolkit for AI Agent Runtime Security
Microsoft has released an open source toolkit for enforcing runtime security policies on AI agents as adoption accelerates faster than governance controls.
mutable-store
Advanced tools
const documentation = `
A lightweight, reactive store pattern for managing application state with simplicity and full control.
The Store function wraps your object and turns it into a reactive store where:
set_ are considered mutative.subscribe(fn) method is provided to listen for changes.Store).get_, action_) are untouched unless you mutate state directly inside them.set_*) trigger updates.Store(mutableState: object)Wrap your state and methods in a store.
import {Store} from "mutable-store";
const counter = Store({
count: 0,
set_increment() {
this.count++;
},
get_count() {
return this.count;
}
});
counter.subscribe(() => {
console.log("State changed!");
});
counter.set_increment(); // Triggers subscriber
console.log(counter.get_count()); // 1
| Prefix | Purpose |
|---|---|
set_* | Used to mutate the store. Triggers updates. |
get_* | Used to read state. Does not trigger updates. |
action_* | Used to orchestrate multiple getters/setters. Can be async or sync. Does not directly mutate state unless via a set_*. |
⚠️ All mutative methods must start with
set_to trigger updates.
You can pass nested stores as part of your store object: This lets you use existing store logic as a substore.
const loadingState = Store({
isLoading : false,
set_isLoading(isLoading) {
this.isLoading = isLoading;
}
});
const usersStore = Store({
users: [],
loadingState, // Nested store
action_fetchUsers() {
this.loadingState.set_isLoading(true);
fetch("/users").then(() => {
this.loadingState.set_isLoading(false);
});
}
});
const photosStore = Store({
photos: [],
loadingState, // Nested store
action_fetchPhotos() {
this.loadingState.set_isLoading(true);
fetch("/photos").then(() => {
this.loadingState.set_isLoading(false);
});
}
});
// Both stores use the same sub store
usersStore.action_fetchUsers(); // ✅ Triggers parent store subscription
photosStore.action_fetchPhotos(); // ✅ Triggers parent store subscription
You can create a store from a class that inherts props or methods from another class. This helps you to create a store from a class that extends another class.
class Counter {
count = 0;
set_increment() {
this.count++;
}
}
class Counter2 extends Counter {
city = "New York";
set_city(newCity:string) {
this.city = newCity;
this.set_increment();
}
}
const counter = Store(new Counter2());
console.log(counter); // {count: 0, city: "New York", set_increment: ƒ, set_city: ƒ}
counter.subscribe(() => {
console.log("Counter changed!");
});
counter.set_city("London"); // ✅ Triggers parent store subscription
subscribe(fn): Adds a listener to the store.___thisIsAMutableStore___: true: Internal flag to identify nested stores.___version___: 1: Reserved for future enhancements.subscribe is a reserved key — do not define it inside your store object.set_* methods.Object.preventExtensions).This store is:
FAQs
a mutable state management library for javascript
The npm package mutable-store receives a total of 1 weekly downloads. As such, mutable-store popularity was classified as not popular.
We found that mutable-store demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Microsoft has released an open source toolkit for enforcing runtime security policies on AI agents as adoption accelerates faster than governance controls.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.