
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
@mvc-react/mvc
Advanced tools
Toolkit for defining MVC applications in Typescript.
npm install --save-dev @mvc-react/mvc
ModelThe Model type encapsulates the essence of any item that can be viewed or interacted with. It represents the item's archetype, and generally consists of a ModelView object—which is where the model's properties are articulated.
Example:
import { Model } from @mvc-react/mvc;
// Our custom ModelView
interface BookView {
title: string;
author: string;
isbn: string;
}
// Our custom Model definition
type BookModel = Model<BookView>;
const book: BookModel = {
modelView: {
title: "Screwtape Letters",
author: "C.S. Lewis",
isbn: "XXXX-XXXXX-XXXXX"
}
}
ReadonlyModelThe ReadonlyModel type represents a Model with an immutable modelView.
InteractiveModelThe InteractiveModel type represents a Model whose modelView changes according to specified model 'interactions'. It consists of an additional interact function, which takes a single ModelInteraction object as an argument and mutates the model's modelView accordingly.
A ModelInteraction object has two properties: type—which specifies the type of interaction to be executed; and an optional input object which encapsulates the interaction's input data if there is any.
Example:
import { InteractiveModel, Model, ModelInteraction } from @mvc-react/mvc;
// Our custom ModelView definition
interface CalculatorView {
display: number;
}
// The interactions our model will handle
type CalculatorInteraction = (
ModelInteraction<"add", {x: number, y: number}> |
ModelInteraction<"subtract", {x: number, y: number}>
)
// Our custom Model definition
type CalculatorModel = InteractiveModel<
CalculatorView,
CalculatorInteraction
>;
// Implemented
const calculator: CalculatorModel = {
modelView: {
display: 0,
},
interact(interaction: CalculatorInteraction) {
switch (interaction.type) {
case "add": {
const { x, y } = interaction.input!;
this.modelView = { display: x + y };
break;
}
case "subtract": {
const { x, y } = interaction.input!;
this.modelView = { display: x - y };
break;
}
}
}
}
// Result
calculator.interact({ type: "add", input: { x: 2, y: 3 } });
console.log(calculator.modelView); // { display: 5 }
newReadonlyModel()Convenience function for constructing a new ReadonlyModel
FAQs
Toolkit for defining MVC applications
The npm package @mvc-react/mvc receives a total of 0 weekly downloads. As such, @mvc-react/mvc popularity was classified as not popular.
We found that @mvc-react/mvc 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
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.