Skip to content

Context separation and REPL #819

Answered by dethell
IngoVals asked this question in Q&A
Mar 27, 2024 · 2 comments · 5 replies
Discussion options

You must be logged in to vote

You are correct that loadContext is the key here. In your example, if your api/person/_context.ts file has implementations that getPerson.ts uses, then you could load them like this:

const personContext = loadContext('/api/person`);
personContext.getPerson('123'); // This will echo the results of that function to the console.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@pmcelhaney
Comment options

@pmcelhaney
Comment options

@pmcelhaney
Comment options

Comment options

You must be logged in to vote
2 replies
@IngoVals
Comment options

@pmcelhaney
Comment options

Answer selected by dethell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants