Skip to content

Instantly share code, notes, and snippets.

@Haroenv
Last active December 16, 2019 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Haroenv/01b77f1fe4d821e171465d7c4718fca8 to your computer and use it in GitHub Desktop.
Save Haroenv/01b77f1fe4d821e171465d7c4718fca8 to your computer and use it in GitHub Desktop.
InstantSearch widget tree
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