You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checktoken as a plugin let me call the function "authenticate" everywhere I need without import the file. That's good.
user queries as a plugin let me access to this set of db queries everywhere (for example in checktoken I can update user last access without import the queries file)
that seems so good but now when I access through fastify context I don't see code suggestions about function (parameters and more..), and I can't navigate fast through functions clicking on them
in more I'm also tempted to make everything a plugin now because it's good having everything everywhere but of course that's not the best way.
So guys, in conclusion, what's for you a plugin? Which example files do you think should be plugins and which ones do you just import?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello guys,
I'm approaching fastify and plugins are very useful but I would like to understand when to use them and when they are not needed.
Two examples:
Some considerations:
So guys, in conclusion, what's for you a plugin? Which example files do you think should be plugins and which ones do you just import?
Thanks to all! <3
Beta Was this translation helpful? Give feedback.
All reactions