Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajwootto committed Dec 2, 2024
1 parent 7400f80 commit fafb1cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions sdk/nextjs/src/client/useVariableValue.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
'use client'
import { DevCycleClient } from '@devcycle/js-client-sdk'
import { useContext, use } from 'react'
import { VariableDefinitions, VariableKey } from '@devcycle/types'
import {
InferredVariableType,
VariableDefinitions,
VariableKey,
} from '@devcycle/types'
import { DVCVariable } from '@devcycle/js-client-sdk'
import { DevCycleProviderContext } from './internal/context'
import { useRerenderOnVariableChange } from './internal/useRerenderOnVariableChange'
Expand Down Expand Up @@ -30,7 +34,7 @@ export const useVariableValue = <
>(
key: K,
defaultValue: ValueType,
): DVCVariable<ValueType>['value'] => {
): InferredVariableType<K, ValueType> => {
return useVariable(key, defaultValue).value
}

Expand Down
6 changes: 5 additions & 1 deletion sdk/nextjs/src/server/getVariableValue.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getClient } from './requestContext'
import {
InferredVariableType,
VariableDefinitions,
VariableKey,
VariableTypeAlias,
Expand All @@ -8,7 +9,10 @@ import {
export async function getVariableValue<
K extends VariableKey,
ValueType extends VariableDefinitions[K],
>(key: K, defaultValue: ValueType): Promise<VariableTypeAlias<ValueType>> {
>(
key: K,
defaultValue: ValueType,
): Promise<InferredVariableType<K, ValueType>> {
const client = getClient()
if (!client) {
console.error(
Expand Down

0 comments on commit fafb1cc

Please sign in to comment.