
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
mobx-store-generator
Advanced tools
Generates React Hooks and React Context for Mobx Stores.
Includes Store persistance out of the box thanks to mobx-persist.
import { HydrateStore, persist, GenerateStore } from "mobx-store-generator";
export type UserStoreProps = typeof StoreImpl;
class Store {
@persist
@observable
public username?: string;
@persist("object")
@observable
public funObject?: { name: string; titles: Array<string> };
constructor() {
this.username = "hello world!";
this.funObject = {
name: "Firaenix",
titles: ["Software Developer"]
};
}
}
const StoreImpl = new Store();
// React Native
HydrateStore(AsyncStorage)("UserStore", StoreImpl);
// Web
HydrateStore(localStorage)("UserStore", StoreImpl);
export const UserStore = GenerateStore(StoreImpl);
import { observer } from 'mobx-react';
import { UserStore, UserStoreProps } from "./UserStore";
type HomePageProps = UserStoreProps;
export const HomePage = observer((props: HomePageProps) => {
const userStore = UserStore.useStore();
return <div>{userStore.username}</div>;
});
import { UserStore, UserStoreProps } from "./UserStore";
type HomePageProps = UserStoreProps;
@UserStore.inject
export class HomePage extends React.Component<HomePageProps> {
public render() {
return <div>{this.props.username}</div>;
}
}
Note: You only need to do this for a single store, if you have multiple, you dont need to do it again.
<UserStore.Provider>
<App />
</UserStore.Provider>
FAQs
Generates React Hooks and React Context for Mobx Stores
We found that mobx-store-generator demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.