All files / src/domain/Store index.js

100% Statements 6/6
100% Branches 2/2
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 156x   6x 2x   3x 1x     2x          
let store = null;
 
const Store = {
  get: () => store,
  set: (newStore) => {
    if (store !== null) {
      throw new Error('Store has already been set!');
    }
 
    store = newStore;
  },
};
 
export default Store;