set Method
Sets a cookie with the specified key and value, stringified before being added to the cookie.
Additional parameters, such as cookie options (e.g., expires
, path
), can be provided as part
of the data
object
@param key: string
The specific key under which the value will be stored
@param value: T
An object containing the new value to store, as well as optional cookie parameters
See also: CookieData
API
set(key: string, value: T): void;
Example
import {cookie} from '@bitfiber/rx';
const ck = cookie();
ck.set('key', {value: 'value'});