Skip to content

Commit

Permalink
Feat: Return CookieConsent instance from the init function
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed Nov 1, 2021
1 parent 10e48b2 commit b217059
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LmcCookieConsentManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const defaultOptions = {
* @param {function} [args.onAcceptOnlyNecessary] - Callback to be executed when consent with only necessary cookies is detected (either given right now or already saved previously)
* @param {function} [args.onAcceptAll] - Callback to be executed when consent with all cookies is detected (either given right now or already saved previously)
* @param {Object} [args.config] - Override default config. See https://github.com/orestbida/cookieconsent/blob/master/Readme.md#all-available-options
* @returns {Object} Instance of the underlying CookieConsent component. For available API, see https://github.com/orestbida/cookieconsent#apis--configuration-parameters
*/
const LmcCookieConsentManager = (args) => {
const options = { ...defaultOptions, ...args };
Expand Down Expand Up @@ -103,6 +104,8 @@ const LmcCookieConsentManager = (args) => {
// override default config if necessary
...config,
});

return cookieConsent;
};

export default LmcCookieConsentManager;

0 comments on commit b217059

Please sign in to comment.