mardi 21 mars 2017

Can I import again in Javascript?

For example in App.js I have

let store = createStore(CombinedReducers, applyMiddleware(promiseMiddleware));

export { store }

When I do import { store as mainStore } from './App' in the other file I think it is going to run createStore before becoming mainStore. Can I do a reimport so this code is run again later? For this instance I do want to reset the store variable's state in between tests. And the createStore method can do just that.

Aucun commentaire:

Enregistrer un commentaire