https://github.com/rramaa/function-override
A basic utility to override some functions
https://github.com/rramaa/function-override
function-hook js
Last synced: 10 months ago
JSON representation
A basic utility to override some functions
- Host: GitHub
- URL: https://github.com/rramaa/function-override
- Owner: rramaa
- License: mit
- Created: 2017-12-18T11:21:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-15T10:19:12.000Z (about 8 years ago)
- Last Synced: 2025-03-13T20:08:20.390Z (11 months ago)
- Topics: function-hook, js
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# function-override
A basic utility to override some functions
Usage
Returns a function which takes in some parameters and returns a new overriden function
The function takes in the `context` as the first parameter, `functionToReplace` as the second parameter and `options` as the third parameter.
`functionToReplace` should be a property of the context. The returned function will be the overridden function.
# options
1. `before`: The function to execute before the original function is executed
2. `after` :The function to execute after the original function is executed