ttag-org / ttag

:orange_book: simple approach for javascript localization
https://ttag.js.org/
MIT License
337 stars 40 forks source link

change current locale type #277

Closed stoyanovk closed 6 months ago

stoyanovk commented 6 months ago

In this PR I added available to add function as arg for useLocale method It's need for resolving problem with global TTag instance when you use SSR and streaming

I made short demo when I use ttag with this changes and AsyncLocalStorage node js api

https://github.com/stoyanovk/asyncstorage_ttag_demo/blob/master/src/index.js

AlexMost commented 6 months ago

Great job, would be great to update doc for the library also https://github.com/ttag-org/ttag/blob/master/docs/library-api.md