Last active
December 16, 2019 10:31
-
-
Save Haroenv/01b77f1fe4d821e171465d7c4718fca8 to your computer and use it in GitHub Desktop.
InstantSearch widget tree
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
tree = indexWidget => indexWidget.getWidgets().map(widget => widget.$$type === 'ais.index' ? { ...widget, children: tree(widget) } : widget); | |
// usage: | |
tree(search.mainIndex) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment