Tiqa / redux-polyglot

Polyglot.js bindings for Redux
MIT License
58 stars 13 forks source link

Add setPolyglotOptions function #68

Open guillaumearm opened 7 years ago

guillaumearm commented 7 years ago

from #67

I'm thinking to add a function setPolyglotOptions to redux-polyglot. even if you can create your own getP, I want to mutate getP polyglot options.

so you can import the basic getP function and use setPolyglotOptions once at the start of your app. This is the easy way to change polyglot options.

createGetP is the pure alternative, very useful for unit testing.

example :

import { setPolyglotOptions } from 'redux-polyglot';

const options = { allowMissing: true };
dispatch(setPolyglotOptions(options));