From b217059e7ff9375f81a9f24fd43abc695e130283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Machulda?= Date: Tue, 26 Oct 2021 15:03:01 +0200 Subject: [PATCH] Feat: Return CookieConsent instance from the init function --- src/LmcCookieConsentManager.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/LmcCookieConsentManager.js b/src/LmcCookieConsentManager.js index b88ccdd0..6b9ca4d5 100644 --- a/src/LmcCookieConsentManager.js +++ b/src/LmcCookieConsentManager.js @@ -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 }; @@ -103,6 +104,8 @@ const LmcCookieConsentManager = (args) => { // override default config if necessary ...config, }); + + return cookieConsent; }; export default LmcCookieConsentManager;