0.1.0 • Published 4 months ago

@tabula/use-track-id v0.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

@tabula/use-track-id

Helps generate track id for analytics purposes.

Installation

Use the package manager pnpm to install @tabula/use-track-id.

pnpm add @tabula/use-track-id

You can use npm or yarn too.

Type

function useTrackId(scope?: string | null | undefined, id?: string | false | null): string | undefined

Usage

import { useTrackId } from "@tabula/use-track-id";

// ...
const trackId = useTrackId("parent", "child");
// ...
ScopeIdResult
undefinedundefinedundefined
undefinednullundefined
undefinedfalseundefined
undefined""undefined
undefined"child"undefined
nullundefinedundefined
nullnullundefined
nullfalseundefined
null""undefined
null"child"undefined
""undefinedundefined
""nullundefined
""falseundefined
""""undefined
"""child"undefined
"parent"undefined"parent"
"parent"null"parent"
"parent"falseundefined
"parent"""undefined
"parent""child""parent--child"

License

This project is ISC licensed.