Skip to content

Commit

Permalink
refactor: upgrade kaop dependency meta.break renamed to meta.skip
Browse files Browse the repository at this point in the history
BREAKING CHANGE: meta.break() renamed to meta.skip()
  • Loading branch information
k1r0s committed Dec 9, 2017
1 parent e464ca8 commit 6904417
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const myCustomAdvice = beforeMethod<MyComponent, 'ngOnInit'>(function() {
meta.commit() // triggers the next advice or method in the
// call stack (mandatory if your advice contains async operations)

meta.break() // prevent execution of following advices until method execution
meta.skip() // prevent execution of following advices until method execution

meta.handle() // returns the exception (if any) and prevents to be thrown.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@
"validate-commit-msg": "^2.10.1"
},
"dependencies": {
"kaop": "^3.1.0"
"kaop": "^4.0.0"
}
}
7 changes: 4 additions & 3 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ export interface Metadata<B> {
key: string,
method: Function,
exception: undefined,
target: Object,
result: undefined,
prevented: undefined,
target: Object,
handle: Function,
commit: Function,
break: Function,
// skip: Function
prevent: Function,
skip: Function
}

export interface AdviceRef<B> {
Expand Down
2 changes: 1 addition & 1 deletion test/advice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Cache = (_ => {

if (meta.scope[CACHE_KEY][meta.key]) {
meta.result = meta.scope[CACHE_KEY][meta.key]
meta.break()
meta.prevent()
}
},
write: meta => {
Expand Down

0 comments on commit 6904417

Please sign in to comment.