diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2021-06-10 12:23:17 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2021-06-10 12:23:17 +0200 |
| commit | fd46c28539cf7c130dfbb0458f7b9057ad4f1e46 (patch) | |
| tree | fc46112bca9a3a13745c6f0d58ef8595efd080ec /client/src/utils.js | |
| parent | d4ba547a722e3ab72a8bd283a3d94d569518ea68 (diff) | |
before refactor
Diffstat (limited to 'client/src/utils.js')
| -rw-r--r-- | client/src/utils.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/client/src/utils.js b/client/src/utils.js index 03416f0..5a0423d 100644 --- a/client/src/utils.js +++ b/client/src/utils.js @@ -28,6 +28,17 @@ export function findParentWithTag(tagName) { } } +export function findParent(func) { + return function startingFromThisNode(node) { + if (func(node)) { + return node; + } else { + return startingFromThisNode(node.parentNode); + } + } +} + + export function childKillerUsingTags(parent) { return function oneOfMyChildren(child) { |
