Gathering detailed insights and metrics for cerebral-mobx
Gathering detailed insights and metrics for cerebral-mobx
Gathering detailed insights and metrics for cerebral-mobx
Gathering detailed insights and metrics for cerebral-mobx
Declarative state and side effects management for popular JavaScript frameworks
npm install cerebral-mobx
Typescript
Module System
Node Version
NPM Version
v2025-06-06_0918
Updated on Jun 06, 2025
v2025-03-25_2048
Updated on Mar 25, 2025
v2025-03-20_1818
Updated on Mar 20, 2025
v2025-03-20_1156
Updated on Mar 20, 2025
Release v2025-02-27_0058
Updated on Feb 27, 2025
release_2020-03-21_1721
Updated on Mar 21, 2020
JavaScript (74.05%)
CSS (23.59%)
HTML (2.21%)
Shell (0.15%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1,995 Stars
2,297 Commits
126 Forks
43 Watchers
16 Branches
78 Contributors
Updated on Jul 03, 2025
Latest Version
1.1.0
Package Id
cerebral-mobx@1.1.0
Size
20.97 kB
NPM Version
3.10.10
Node Version
6.11.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
1
Combine Cerebral with Mobx state-tree.
With Mobx state tree you also define models, in addition to state. You do this directly in your modules:
modules/app.js
1import { types } from 'mobx-state-tree' 2import {set} from 'cerebral/operators' 3import {state, props} from 'cerebral/tags' 4 5const Box = types.model('Box', { 6 id: types.identifier(), 7 name: '', 8 x: 0, 9 y: 0, 10 get width() { 11 return this.name.length * 15 12 } 13}) 14 15export default { 16 model: { 17 boxes: types.map(Box), 18 selection: types.reference(Box) 19 }, 20 state: { 21 boxes: {}, 22 selection: null 23 }, 24 signals: { 25 boxSelected: set(state`app.selection`, state`app.boxes.${props`boxKey`}`) 26 } 27}
Instead of creating the controller from cerebral
, you create it from this package:
1import {Controller} from 'cerebral-mobx' 2import app from './modules/app' 3 4export default Controller({ 5 modules: {app} 6 // Other config options are the same 7})
For example using React you will need the package mobx-react and use the provide() method of the controller:
main.js
1import React from 'react' 2import {render} from 'react-dom' 3import controller from './controller' 4import {Provider} from 'mobx-react' 5import App from './components/App' 6 7render(( 8 <Provider {...controller.provide()}> 9 <App /> 10 </Provider> 11))
App.js
1import React from 'react' 2import {observer, inject} from 'mobx-react' 3 4@observer 5@inject('store', 'signals') 6class App extends React.Component { 7 renderBoxes () { 8 const {store, signals} = this.props 9 10 return Object.keys(store.app.boxes).map((boxKey) => { 11 return ( 12 <li onClick={() => signals.app.boxSelected({boxKey})}> 13 {store.app.boxes[boxKey].name} 14 </li> 15 ) 16 }) 17 } 18 render () { 19 const {store} = this.props 20 21 return ( 22 <div> 23 <h1>{store.app.selection && store.app.selection.name}</h1> 24 <ul> 25 {this.renderBoxes()} 26 </ul> 27 </div> 28 ) 29 } 30} 31 32export default App
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
3 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
dangerous workflow patterns detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More