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
So, please, check this code snippet (only changed lines attached):
// In types.tsexporttypeI18nThis=Service<{i18n: I18NSettings}>&ServiceMethods;// In index.ts// ...asyncstarted(){const_this=thisasunknownasI18nThis// This is the working solution without warningsconstfiles=awaitreadFilesSync(_this.settings.i18n.dirName)// Use _this instead of thisfor(consttranslationoffiles){// ..._this.settings.i18n.polyglot.extend(object)// Use _this instead of this}}
This reassignment through the unknown allows to use your typed service schema with settings, methods, etc. inside lifecycle handlers like created, started, etc.
The text was updated successfully, but these errors were encountered:
Hi! Can't create PR, cause push is not allowed :(
So, please, check this code snippet (only changed lines attached):
This reassignment through the
unknown
allows to use your typed service schema with settings, methods, etc. inside lifecycle handlers likecreated
,started
, etc.The text was updated successfully, but these errors were encountered: