wearethoughtfox / amnesty-facebook

0 stars 0 forks source link

Load the dictionary async #66

Closed robertocarroll closed 7 years ago

robertocarroll commented 7 years ago

The problem with async loading the dictionary was that the templateContext in all the views needed the strings straight away.

By putting the templateContext in a function like this: https://jsfiddle.net/marionettejs/4qxk99ya/ we might be able to stop the views from needing the strings until they are initialised.

robertocarroll commented 7 years ago

I've tried this solution in https://github.com/wearethoughtfox/amnesty-facebook/tree/async-dictionary

and I think it works. What do you reckon?

pauldwaite commented 7 years ago

Looks good, I’ve commented on the pull request.

robertocarroll commented 7 years ago

Excellent. Thanks! Wouldn't have caught those things so much appreciated.

pauldwaite commented 7 years ago

No problem — really it’s just me having an excuse to muck about with promises.