Skip to content

Commit

Permalink
docs: add some documentation to explain the reason of some params
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-prontera committed Dec 18, 2023
1 parent 7aaf9c0 commit ee435b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions modules/cmpapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ cmpApi.update(null);

````

### Options for performance improvements
The third argument of the CmpApi.update method is an object of options that can be provided
to improve the performance of skipping some calls to TCString.decode method.

````javascript

// preDecodedTCModel is useful if you already have the relative TCModel of the encodedTCString
// this will enable you to skip the TCString.decode call
// decodeWithCache if set to true it will call the TCString.decode using the previously TCModel decoded in cache
// this skip a lot of works
cmpApi.update(encodedTCString, false, {preDecodedTCModel: null, decodeWithCache: false});
````

## Disabling the CmpApi
If, for any reason, we are unable to perform the operations in compliance with
the TCF and thus should not continue to serve page request commands (other than ping),
Expand Down
4 changes: 4 additions & 0 deletions modules/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ const myTCModel = TCString.decode(encodedTCString);

```

#### Using cache (memoization) to optimize decode performance
The third argument of TCString.decode enables you to use the previously TCModel created.
Use if you encounter some extra decoding work that can be skipped.

*returns:* [`TCModel`](#tcmodel)

### Encode an IAB TC String
Expand Down

0 comments on commit ee435b3

Please sign in to comment.