How to use the js-cookie.noConflict function in js-cookie

To help you get started, we’ve selected a few js-cookie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / js-cookie_v2.x.x / flow_v0.38.x- / test_js-cookie-v2.x.x.js View on Github external
// $ExpectError
Cookie.removeCookie()

Cookie.set('data', {
    a: 1,
    b: 3
}, { secure: true });


// $ExpectError
Cookie.getJson();

const data: Object = Cookie.getJSON('data');


const otherCookie = Cookie.noConflict();

otherCookie.set('name', 'OtherCookie');


const cookieWithConverter = otherCookie.withConverter((value: string, name: string): string => {
    return value;
});

cookieWithConverter.defaults = {
    secure: true
};


// $ExpectError
Cookie.defaults = {
    secure: 1