Created
November 5, 2024 10:57
-
-
Save leeight/0652c89492e77e90fb9fd5cfbd0ea31e to your computer and use it in GitHub Desktop.
sample.js
This file contains hidden or 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
// Arrow characters to use: ▼ ▶ • | |
const backendData = [ | |
{ | |
id: "1", | |
name: "Office Map" | |
}, | |
{ | |
id: "2", | |
name: "New Employee Onboarding", | |
children: [ | |
{ | |
id: "8", | |
name: "Onboarding Materials" | |
}, | |
{ | |
id: "9", | |
name: "Training" | |
} | |
] | |
}, | |
{ | |
id: "3", | |
name: "Office Events", | |
children: [ | |
{ | |
id: "6", | |
name: "2018", | |
children: [ | |
{ | |
id: "10", | |
name: "Summer Picnic" | |
}, | |
{ | |
id: "11", | |
name: "Valentine's Day Party" | |
}, | |
{ | |
id: "12", | |
name: "New Year's Party" | |
} | |
] | |
}, | |
{ | |
id: "7", | |
name: "2017", | |
children: [ | |
{ | |
id: "13", | |
name: "Company Anniversary Celebration" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
id: "4", | |
name: "Public Holidays" | |
}, | |
{ | |
id: "5", | |
name: "Vacations and Sick Leaves" | |
} | |
]; | |
function fetchData() { | |
return new Promise(resolve => { | |
setTimeout(resolve, 100, backendData); | |
}); | |
} |
Author
leeight
commented
Nov 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment