Skip to content

Commit

Permalink
add missing src/active.mjs from template
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jun 20, 2024
1 parent 090f547 commit 4884489
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/active.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Keeps the node active state in sync.
* @see {Router.updateActive}
* @param {Element} node
* @param {Router} router
*/
export function active(node, router) {
router.linkNodes.add(node);
router.updateActive(node);

return {
destroy() {
router.linkNodes.delete(node);
}
};
}

0 comments on commit 4884489

Please sign in to comment.