Skip to content

Commit

Permalink
Rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBitz committed Apr 30, 2024
1 parent 019cbb4 commit 8c89c51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/web/src/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ function inject(
window.va?.('beforeSend', props.beforeSend);
}

if (props.setDefaultProps) {
window.va?.('setProps', props.setDefaultProps());
if (props.setInitialProps) {
window.va?.('setProps', props.setInitialProps());
}

const src =
Expand Down
8 changes: 6 additions & 2 deletions packages/web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface FlagsData {
/** All encrypted flags that were found, which will get decrypted later. */
e?: string[];
}
interface DefaultProps {
interface InitialProps {
$getFlags?: (input: {
type: string;
data?: unknown;
Expand All @@ -41,7 +41,11 @@ export interface AnalyticsProps {

dsn?: string;

setDefaultProps?: () => DefaultProps;
/**
* A function that will be called before the Analytics script starts
* processing events to set initial values for specific properties for them.
*/
setInitialProps?: () => InitialProps;
}
declare global {
interface Window {
Expand Down

0 comments on commit 8c89c51

Please sign in to comment.