[medusa-interfaces] : Adds decorator functionality to BaseService (#39)

Plugins and projects can add decorators in services. E.g. if a plugin needs to load some additional information on carts the plugin can register a decorator via: `cartService.addDecorator(someFunc)` which will be available later through `cartService.runDecorators()`.
This commit is contained in:
Sebastian Rindom
2020-04-30 20:40:22 +02:00
committed by GitHub
parent a53822d298
commit 9c76754e79
15 changed files with 112 additions and 654 deletions
+6 -2
View File
@@ -11,7 +11,8 @@
"scripts": {
"build": "babel src --out-dir dist/ --ignore **/__tests__",
"prepare": "cross-env NODE_ENV=production npm run build",
"watch": "babel -w src --out-dir dist/ --ignore **/__tests__"
"watch": "babel -w src --out-dir dist/ --ignore **/__tests__",
"test": "jest"
},
"author": "Sebastian Rindom",
"license": "AGPL-3.0-or-later",
@@ -21,8 +22,11 @@
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.7.6",
"@babel/preset-env": "^7.7.5",
"@babel/runtime": "^7.9.6",
"cross-env": "^5.2.1",
"eslint": "^6.8.0"
"eslint": "^6.8.0",
"jest": "^25.5.0",
"prettier": "^1.19.1"
},
"dependencies": {
"mongoose": "^5.8.0"