Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
mobx-simple-store
Advanced tools
Mobx Simple Store (also MSS) is a wrapper around Mobx that helps the user create a reactive state tree store with an opinionated structure and setters that can read JSON objects.
Mobx Simple Store (also MSS) is a wrapper around Mobx that helps the user create a reactive state tree store with an opinionated structure and setters that can read JSON objects.
As heavy users of Mobx State Tree (MST), we loved using it. The State Tree along with the types.model
structure boosted our productivity a lot. One of the only problems with MST is its low performance when handling large amounts of data. These are described at https://github.com/mobxjs/mobx-state-tree/issues/1683 and https://github.com/mobxjs/mobx-state-tree/issues/440.
It was clear that those were MST problems and not Mobx specific. Because of that we created MSS to be a close alternative to MST but removed some of the features that cause those performance issues. Here is a list of differences between MSS and MST.
this
while MST creates them using the action binding with self
.import { toGenerator, types, createStore } from "mobx-simple-store";
const Loading = types
.model({
loading: types.boolean,
})
.actions({
setLoading(val: boolean) {
this.loading = val;
},
});
const CounterStore = types
.compose(
Loading,
types.model({
count1: types.number,
count2: types.number,
countArr: types.maybeNull(types.array(types.string)),
})
)
.views({
get sumCount() {
return this.count1 + this.count2;
},
})
.actions({
incrementCount1() {
this.count1++;
},
})
.actions({
*asyncIncrementCount() {
this.loading = true;
this.count1 = 5;
yield* toGenerator(delay(3000));
this.loading = false;
this.count1 = 10;
return 10;
},
incrementCount2() {
this.count2++;
},
setDataArr(data: any) {
this.countArr = data;
},
});
const useCounterStore = createStore({
model: CounterStore,
initialData: {
count1: 0,
count2: 0,
countArr: undefined,
},
windowPropertyName: "counterStore",
});
const counterStore = useCounterStore();
For more examples, check packages/sandbox
FAQs
Mobx Simple Store (also MSS) is a wrapper around Mobx that helps the user create a reactive state tree store with an opinionated structure and setters that can read JSON objects.
The npm package mobx-simple-store receives a total of 0 weekly downloads. As such, mobx-simple-store popularity was classified as not popular.
We found that mobx-simple-store demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.