-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prevent infinite loops with nested observe and intercept
- Loading branch information
1 parent
928e70c
commit 07a93c9
Showing
6 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const createPostInterceptMiddleware = (callbacks: Array<() => void>) => { | ||
return (store: any) => (next: any) => (action: any) => { | ||
const result = next(action); | ||
|
||
callbacks.forEach((cb, index) => { | ||
cb(); | ||
}); | ||
|
||
callbacks.length = 0; | ||
|
||
return result; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const strip = require('@rollup/plugin-strip'); | ||
|
||
module.exports = { | ||
rollup(config, options) { | ||
config.plugins.push( | ||
strip({ | ||
include: ['**/*.js', '**/*.ts'], | ||
functions: options.env === 'production' ? ['console.log'] : [], | ||
debugger: options.env === 'production' ? true : false, | ||
}) | ||
); | ||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters