CodeByZach / pace

Automatically add a progress bar to your site.
https://codebyzach.github.io/pace/
MIT License
15.68k stars 1.9k forks source link

Import Pace and use paceoptions before it #522

Closed dotnetshadow closed 2 years ago

dotnetshadow commented 3 years ago

Hi there,

If I put import Pace from 'pace-js' in my script, how can I setuppaceOptions` before it. It seems the import happens before paceOptions has a chance to be set.

How are people using pace-js in their scripts?

marcomarsala commented 2 years ago

window.paceOptions

dotnetshadow commented 2 years ago

Thanks for the respsonse

window.paceOptions

You mean add this before my import statement?

    eventLag: false // disabled
    //eventLag: {
    //    lagThreshold: 30
    //}
};

import Pace from pace-js
marcomarsala commented 2 years ago

yes it should work as per documentation


Da: DotnetShadow @.> Inviato: mercoledì 14 settembre 2022 04:28 A: CodeByZach/pace @.> Cc: Marco Marsala @.>; Comment @.> Oggetto: Re: [CodeByZach/pace] Import Pace and use paceoptions before it (#522)

Y

window.paceOptions

You mean add this before my import statement?

`window.paceOptions = { eventLag: false // disabled //eventLag: { // lagThreshold: 30 //} };

import Pace from pace-js`

— Reply to this email directly, view it on GitHubhttps://github.com/CodeByZach/pace/issues/522#issuecomment-1246153400, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABI2CVUHFTPPOR4UZR6E6FDV6EZ5XANCNFSM44BX7PXA. You are receiving this because you commented.Message ID: @.***>

dotnetshadow commented 2 years ago

Thanks that worked, much appreciated