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
/** | |
* Finds any matches within the given object that satisfy the given search | |
* function. | |
* | |
* @param {Object} object | |
* Object to search. | |
* @param {Function} search | |
* Function that will identify a match. The function is passed the | |
* key, the value, and the full path. If it returns any truthy value | |
* then the result will be considered a match. |
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
/** | |
* Takes an element and finds the parent element that would scroll. | |
* | |
* @param {Element} element | |
* Element whose scrolling parent should be returned. | |
* @return {Element|null} | |
* Parent element that scrolls. If no parent can be found, null is | |
* returned. | |
*/ | |
function getScrollingParent(element) { |
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
<!doctype html> | |
<html lang="en-GB"> | |
<head> | |
<title>Testing reactivity</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1,width=device-width"> | |
</head> |
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
export class Cache< | |
TLookupMap extends Record<string, any> = {}, | |
K extends keyof TLookupMap = keyof TLookupMap | |
> { | |
private key: string; | |
private storage: Record<K, TLookupMap[K]>; | |
constructor(key: string) { |