Why doesn't Fastify allow plugins to return a value as the promised value of fastify.register? #4686
Unanswered
Worldwidebrine
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Indeed, it seems to be a mismatch between the Types and what Fastify actually does. In any case, can you elaborate what is the value you expect by allowing plugins to return a specific value after the plugin is registered? Just want to understand what are you trying to achieve 🙂 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
FastifyPluginCallback
andFastifyPluginAsync
returnvoid
.fastify.register(...)
returnsFastifyInstance<...> & PromiseLike<undefined>
, soawait fastify.register(...)
is alwaysundefined
.Why doesn't Fastify allow plugins to return a value and let it be the promised value of
fastify.register
?According to .d.ts files, the result should be
[object Object] undefined
, but actually[object Object] [object Object]
both of them are objects.Why shouldn't it be
[object Object] test
?Beta Was this translation helpful? Give feedback.
All reactions