Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
feat(ConfigContainer): now uses Proxy to create proxy class
Browse files Browse the repository at this point in the history
  • Loading branch information
mdreizin committed Aug 9, 2017
1 parent 90e9a59 commit ef454a1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
}
},
"presets": [
"env"
["env", {
"targets": {
"node": 6
}
}]
],
"plugins": [
["babel-plugin-transform-builtin-extend", {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,8 @@
"lodash": "^4.17.4",
"recursive-iterator": "^2.0.3",
"yargs-parser": "^7.0.0"
},
"engines": {
"node": ">=6.0.0"
}
}
8 changes: 6 additions & 2 deletions src/ConfigContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ class ConfigContainer {

/**
* @param {*} T
* @returns {Function}
* @returns {Proxy<T>}
*/
proxy(T) {
return () => this.resolve(T);
return new Proxy(function() {}, {
construct: () => {
return this.resolve(T);
}
});
}
}

Expand Down

0 comments on commit ef454a1

Please sign in to comment.