-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Updated eslint and plugin versions
2. Added the AirBnB eslint config to inherit 3. Fixed all linter findings
- Loading branch information
Erin Doyle
committed
Apr 9, 2017
1 parent
36589bf
commit d0401be
Showing
37 changed files
with
1,503 additions
and
1,801 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/ | ||
webpack.config.js |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,43 +1,43 @@ | ||
|
||
// store how to undo these changes | ||
let restoreFunctions = [] | ||
let restoreFunctions = []; | ||
|
||
// does nothing | ||
const noop = () => null | ||
const noop = () => null; | ||
|
||
const after = function (host, name, cb) { | ||
if ( !host ) { | ||
throw new Error('cannot replace function on undefined') | ||
} | ||
const after = (host, name, cb) => { | ||
if (!host) { | ||
throw new Error('cannot replace function on undefined'); | ||
} | ||
|
||
// save original | ||
const original = host[name] || noop | ||
// save original | ||
const original = host[name] || noop; | ||
|
||
// override host | ||
host[name] = function (...args) { | ||
// override host | ||
host[name] = (...args) => { | ||
// perform original | ||
original.apply(this, args) | ||
original.apply(this, args); | ||
// perform cb | ||
cb.apply(this, args) | ||
} | ||
cb.apply(this, args); | ||
}; | ||
|
||
// save restoring function | ||
restoreFunctions.push(function () { | ||
host[name] = original | ||
}) | ||
} | ||
// save restoring function | ||
restoreFunctions.push(() => { | ||
host[name] = original; | ||
}); | ||
}; | ||
|
||
after.restorePatchedMethods = function () { | ||
// perform each restoring function | ||
restoreFunctions.forEach(restore => restore()) | ||
after.restorePatchedMethods = () => { | ||
// perform each restoring function | ||
restoreFunctions.forEach(restore => restore()); | ||
|
||
// clear the list of functions to restore | ||
restoreFunctions = [] | ||
} | ||
// clear the list of functions to restore | ||
restoreFunctions = []; | ||
}; | ||
|
||
after.render = function (component, fn) { | ||
after(component, 'componentDidMount', fn) | ||
after(component, 'componentDidUpdate', fn) | ||
} | ||
after.render = (component, fn) => { | ||
after(component, 'componentDidMount', fn); | ||
after(component, 'componentDidUpdate', fn); | ||
}; | ||
|
||
export default after | ||
export default after; |
Oops, something went wrong.