Skip to content

Commit 4ccf37a

Browse files
committed
allow updating shared instance options
1 parent 4b55688 commit 4ccf37a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,6 @@ export class I18n {
365365
* Gets the shared I18n instance, instantiating it if not yet created
366366
*/
367367
static getSharedInstance(options?: OptionsInterface): I18n {
368-
return (sharedInstance ??= new I18n(options))
368+
return sharedInstance?.setOptions(options) || (sharedInstance = new I18n(options))
369369
}
370370
}

0 commit comments

Comments
 (0)