demarches-normaliennes/app/javascript/shared/data.js
2018-07-25 15:14:06 +02:00

13 lines
248 B
JavaScript

const _DATA = {};
function setupData() {
if (window.DATA.length) {
Object.assign(_DATA, ...window.DATA);
window.DATA.length = 0;
}
}
export function getData(namespace) {
setupData();
return namespace ? _DATA[namespace] : _DATA;
}