Skip to content

Commit

Permalink
inject.args no longer replaces ctor arguments, it only appends more args
Browse files Browse the repository at this point in the history
  • Loading branch information
k1r0s committed Jan 12, 2018
1 parent 4c4c021 commit f5c4bc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions rollup.config.js
Expand Up @@ -7,9 +7,8 @@ export default [
{
input: 'src/index.js',
output: [
{ file: pkg.browser, format: 'umd' }
{ file: pkg.browser, name: 'kaop', format: 'umd' }
],
name: 'kaop',
plugins: [
uglify(),
commonjs(),
Expand Down
2 changes: 1 addition & 1 deletion src/inject.js
Expand Up @@ -4,7 +4,7 @@ function args(){
const providers = Array.prototype.slice.call(arguments);
return reflect.advice(function(meta) {
if (meta.key !== "constructor") { throw new Error("inject only available in constructor") }
meta.args = providers.map(function(provider) { return provider() });
providers.forEach(function(provider) { meta.args.push(provider()) });
})
}

Expand Down

0 comments on commit f5c4bc4

Please sign in to comment.