Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make options configurable on Mojito library init #67

Open
kingo55 opened this issue May 19, 2020 · 1 comment
Open

Make options configurable on Mojito library init #67

kingo55 opened this issue May 19, 2020 · 1 comment

Comments

@kingo55
Copy link
Member

kingo55 commented May 19, 2020

Currently default "Options" are intermingled with the library code which makes it awkward for users to override defaults.

https://github.com/kingo55/mojito-js-delivery/blob/9f313bd1ba59f1f8dcb80cc4df41b6b02b08f28c/lib/mojito.js#L4-L14

Might there be a way we could initialise Mojito explicitly? e.g.:

// lib code
...

Mojito.init({
  debug: false,
  cookieDuration: 7,
  ...
});

Or is the current approach better? I.e. sane defaults hardcoded and users override specific options like:

Mojito.options.excluded = true;
@allmywant
Copy link
Member

@kingo55
I think Mojito.init({ options }) is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants