Is it possible to modify a function in a helper via the plugin or theme component system?

If you’re trying to change the HTML for the spinner that shows up between page loads then

discourse\helpers\loading-spinner.js

is probably not what you’re looking for. That helper generates the small spinner that you see in the composer and search menu… etc.

If you want to change the main spinner that shows up while pages are loading then you’re looking for this

https://github.com/discourse/discourse/blob/7a2e8d3ead63c7d99e1069fc7823e933f931ba85/app/assets/javascripts/discourse/app/templates/components/conditional-loading-spinner.hbs

You can override the template for that spinner like so

<script type="text/x-handlebars" data-template-name="components/conditional-loading-spinner">
{{#if condition}}
  <!-- the html for your custom spinner goes here -->
{{else}}
  {{yield}}
{{/if}}
</script>

in the </head> tab of a theme / theme component and then add the required CSS for the custom spinner.

6 Likes