question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support mixin `@Ctx`

See original GitHub issue

example

// import something
const app = new Koa() 
app.use(ctx=>{
 ctx.foo = 123
})

class Example {
  @Get('/xxx')
  foo(@Ctx() ctx) {
    console.log(ctx.foo) // why undefined ???
  }
}

useKoaServer(app, {
  controllers:  [Example]
})

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
crycimecommented, Mar 30, 2019

I also have this problem.

0reactions
github-actions[bot]commented, Dec 12, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for mixins · Issue #1041 · sveltejs/svelte - GitHub
Hi everyone! To continue the conversation begun in a chat, I want to suppose my vision of Mixin implementation to Svelte.
Read more >
Mixins - The Modern JavaScript Tutorial
JavaScript does not support multiple inheritance, but mixins can be implemented by copying methods into prototype. We can use mixins as a way...
Read more >
Defining mixins | LoopBack Documentation
Use mixins to apply common logic to a set of models. For example, a timestamp mixin could inject “created” and “modified” properties to...
Read more >
TpPropertiesMixin: telepathy-glib API Reference Manual
TpPropertiesMixin — a mixin implementation of the Telepathy.Properties interface ... An object with the properties mixin. ctx. A properties context.
Read more >
moleculerjs/moleculer - Gitter
However, when I call the identity service using ctx.call method the passport mixin is not being invoked! Here is my authorize method.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found