-
Notifications
You must be signed in to change notification settings - Fork 0
FunctionData
paige edited this page Nov 17, 2023
·
6 revisions
type for function data
type: Class
arguments:
- sync
Boolean
tells it if it should fetch in sync or not
- f
Function
function input to fetch from
works with most functions
- ?callback
Function
optional function that runs when the function data is fetched
- ?catcher
Function
optional function that catches errors
| π then() | Function |
adds a new data listener |
| π catch() | Function |
adds a new error listener |
| π pending | Boolean |
if the data is pending or not |
| π name | String |
fetched name of the function |
| π dataName | String |
name of the given function |
| π body | String |
body of the function |
| π arguments | Object |
function arguments |
| π isAsync | Boolean |
if the function is an async function |
| π isArrow | Boolean |
if the function is an arrow function |
| π data | Function |
the given function |
| π string | String |
the given function as a string |
| JS | Output |
const { FunctionData } = require('fndt');
function test(a, b="placeholder") {
console.log(a, b);
}
new FunctionData(false, test, (data) => {
console.log(data);
}); |
FunctionData {
pending: false,
name: "test",
dataName: "test",
body: "console.log(a, b);",
arguments: { a: null, b: "placeholder" },
data: Function,
string: "function test(a, b="placeholder") {
console.log(a, b);
}"
} |