Algolia - Shopify Code - algolia_init.js.liquid - Question

Hi there! There are the 3 arguments: $ and _ and Shopify being passed to the function in algolia_init.js.liquid. Where is Shopify object instantiated and where is the source file?

(function (algolia, , _, Shopify) { ... }(algoliaShopify, , _, Shopify));

Thank you!

Hi Steve,

The provided 4 parameters/arguments are as follows:

  • algolia/algoliaShopify is the algolia shopify plugin object with all settings & config
  • $ is the version of query available from Shopify directly
  • _ is the JavaScript utility library Underscore
  • Shopify is the Shopify Store object with all settings & config

They’re passed in as Global Objects down at the bottom of the function using an IIFE

Best regards,