Why use providers instead of stores? #460
-
Hi Sebastian, happy to see an i18n package leveraging Fluent. Is there deeper reasoning, other than replicating Reacts implementation, to use a provider pattern instead of using stores? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi Samuel, the Provider definitely started out from trying to follow fluent-react's API. The provider at it's core is just a renderless component that initializes some stores used internally by the There's no deeper reasoning than that :) |
Beta Was this translation helpful? Give feedback.
Hi Samuel,
the Provider definitely started out from trying to follow fluent-react's API. The provider at it's core is just a renderless component that initializes some stores used internally by the
Localized
andOverlay
components. It also serves as a nice place to dispatch errors (currently only missing translations) which can be subscribed to via<FluentProvider on:error={doSomething} />
.There's no deeper reasoning than that :)