Gathering detailed insights and metrics for @bugaboo/babel-plugin-mobx-deep-action
Gathering detailed insights and metrics for @bugaboo/babel-plugin-mobx-deep-action
Gathering detailed insights and metrics for @bugaboo/babel-plugin-mobx-deep-action
Gathering detailed insights and metrics for @bugaboo/babel-plugin-mobx-deep-action
Reduces `action` and `runInAction` boilerplates
npm install @bugaboo/babel-plugin-mobx-deep-action
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
71 Commits
3 Branches
1 Contributors
Updated on Aug 03, 2021
Latest Version
2.0.3
Package Id
@bugaboo/babel-plugin-mobx-deep-action@2.0.3
Unpacked Size
22.70 kB
Size
5.71 kB
File Count
4
NPM Version
6.14.8
Node Version
14.15.1
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
Allow to reduce boilerplate of writing async actions. Based on assumption, that all code created inside an action, should be handled as action too.
This plugin scans for all functions, marked as actions, and then marks all nested functions, which created inside actions as actions too.
In
1import { action } from "mobx"; 2 3action(function doSome() { 4 fetch("/api/list").then(function(response) { 5 this.items = response.dta; 6 }); 7});
Out
1"use strict"; 2 3import { action } from "mobx"; 4 5action(function doSome() { 6 fetch("/api/list").then(action(function(response) { 7 this.items = response.dta; 8 })); 9});
Plugin support only ES6 imports.
If you use makeAutoObserver for class of store,that I had done what imported.
if you not use makeAutoObserver,please import action
from mobx.
Only these imports are supported:
import {action} from "mobx";
import {action as actionAlias} from "mobx";
import * as mobx from "mobx";
import * as mobxAlias from "mobx";
For example, these cases are not supported:
const mobx = require("mobx")
const {action} = require("mobx")
import * as mobx from "my-mobx-alias"
import * as mobx from "mobx";
const {action} = mobx;
action(function() {});
1$ npm install babel-plugin-mobx-deep-action
.babelrc
(Recommended).babelrc
1{ 2 "plugins": ["mobx-deep-action"] 3}
1$ babel --plugins mobx-deep-action script.js
1require("babel-core").transform("code", { 2 plugins: ["mobx-deep-action"] 3});
see https://github.com/Strate/babel-plugin-mobx-async-action
This plugin could handle decorators code, emitted from typescript, such as:
1import * as tslib_1 from "tslib"; 2import { action } from "mobx"; 3export default class Class2 { 4 async method() { 5 const a = (other) => { }; 6 return a(function () { }); 7 } 8} 9tslib_1.__decorate([ 10 action 11], Class2.prototype, "method", null);
To get this code worked, you should enable importHelpers compiler option, and get tslib package installed. Also, typescript should emit es6 modules, so, you should target your compiler to es2015+. That's all, plugin detect import from "tslib" and handle typescript decorators.
If you use wrapper for "mobx" package, you can pass it's name to plugin:
1{ 2 "plugins": [ 3 ["mobx-deep-action", { 4 "mobx-package": "mobx-custom" 5 }] 6 ] 7}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
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
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
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