Skip to content

Commit

Permalink
add note about deprecating provideTelefuncContext()
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Nov 14, 2022
1 parent b848f61 commit 3ce4dbe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion telefunc/node/server/getContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
restoreContext_sync,
getContextOptional_sync
} from './getContext/sync'
import { assert, assertUsage, isObject, getGlobalObject } from '../utils'
import { assert, assertUsage, assertWarning, isObject, getGlobalObject } from '../utils'
import type { Telefunc } from './getContext/TelefuncNamespace'
import { provideErrMsg } from './getContext/provideErrMessage'

Expand Down Expand Up @@ -50,6 +50,8 @@ function getContextOptional() {
}

function provideTelefuncContext<Context extends object = Telefunc.Context>(context: Context) {
// TODO: check whether it's possible to deprecate `provideTelefuncContext()` for Nuxt
// assertWarning(false, 'provideTelefuncContext() is deprecated', { onlyOnce: true })
globalObject.neverProvided = false
globalObject.provideTelefuncContext(context)
}
Expand Down

0 comments on commit 3ce4dbe

Please sign in to comment.