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
| var mergeTwoLists = function(l1, l2) { | |
| const newNode = new ListNode(-1); | |
| function mergeTwoListsRec(newL1Head, newL2Head, prevHead) { | |
| if(!newL1Head || !newL2Head) { | |
| prevHead.next = (newL1Head || newL2Head); | |
| return; | |
| } | |
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
| intersectionCallback(entries, observer) { | |
| const self = this; | |
| entries.forEach(entry => { | |
| if(entry.isIntersecting) { | |
| // append the current row in visible area | |
| const divToAppendReactElement = document.createElement('div'); | |
| divToAppendReactElement.id = `dom${this.currentScrollPosition}`; | |
| const newElement = ReactDOM.render(self.configureInsertedElement(), divToAppendReactElement); | |
| const parentNode = entry.target.parentNode; | |
| const target = document.getElementById(`end-sentinel${this.currentScrollPosition}`); |