Skip to content

Commit

Permalink
Merge pull request #686 from alanbiju79/update-setCookieData-document…
Browse files Browse the repository at this point in the history
…ation-example

docs: fix invalid/outdated method in code block
  • Loading branch information
orestbida authored Jun 3, 2024
2 parents a285740 + 2d65695 commit c4d512f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,30 +464,30 @@ Save custom data into the cookie. Returns `true` if the data was set successfull
```javascript
// First set: true
CookieConsent.setData({
CookieConsent.setCookieData({
value: {id: 21, lang: 'it'}
}); //{id: 21, lang: 'it'}
// Change only the 'id' field: true
CookieConsent.setData({
CookieConsent.setCookieData({
value: {id: 22},
mode: 'update'
}); //{id: 22, lang: 'it'}
// Add a new field: true
CookieConsent.setData({
CookieConsent.setCookieData({
value: {newField: 'newValue'},
mode: 'update'
}); //{id: 22, lang: 'it', newField: 'newValue'}
// Change 'id' to a string value: FALSE
CookieConsent.setData({
CookieConsent.setCookieData({
value: {id: 'hello'},
mode: 'update'
}); //{id: 22, lang: 'it', newField: 'newValue'}
// Overwrite: true
CookieConsent.setData({
CookieConsent.setCookieData({
value: 'overwriteEverything'
}); // 'overwriteEverything'
```
Expand Down

0 comments on commit c4d512f

Please sign in to comment.