@rentspree/cookie

1.0.9 • Public • Published

Installation

npm install @rentspree/cookie

Update a newer version

run

npm version patch

Table of Contents

setOption

Set options for the to be stored cookies.

Parameters

  • options Object (optional, default {})

addChangeListener

Add a listener to when a cookie is set or removed.

Parameters

removeChangeListener

Remove a listener from the change callback.

Parameters

setLocalItem

Set a cookie value.

Parameters

getLocalItem

Get a cookie value.

Parameters

  • name string Cookie's name
  • options Object Cookie's options (optional, default {})

Returns any cookie or false if cookie is not found.

getAllLocalItem

Get all cookies.

Parameters

  • options Object (optional, default {})

Returns all cookies.

removeLocalItem

Remove a cookie.

Parameters

  • name string Cookie's name
  • options Object Cookie's options (optional, default {})

removeAllLocalItem

Remove all cookies that has the same prefix as the parameter.

Parameters

  • prefix string Prefix of the cookie to be removed

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Readme

Keywords

none

Package Sidebar

Install

npm i @rentspree/cookie

Weekly Downloads

1

Version

1.0.9

License

MIT

Unpacked Size

21.2 kB

Total Files

10

Last publish

Collaborators

  • karnphongkie
  • puttpotsawee
  • jiratb