@lomray/react-mobx-manager
Version:
This package provides Mobx stores manager for react.
3 lines (2 loc) • 652 B
JavaScript
const s={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},e=/[&><\u2028\u2029]/g;class t{isPreamblePushed=!1;manager;constructor(s){this.manager=s}htmlEscape(t){return t.replace(e,(e=>s[e]))}take(s){const e=this.manager.getSuspenseRelations().get(s);if(!e?.size)return;const t=this.htmlEscape(JSON.stringify(JSON.stringify(this.manager.toJSON([...e])))),i=this.isPreamblePushed?"":"<script>!window.mbxM && (window.mbxM = []);<\/script>";return this.isPreamblePushed||(this.isPreamblePushed=!0),`${i}<script>window.mbxM.push(JSON.parse(${t}));<\/script>`}}export{t as default};
//# sourceMappingURL=manager-stream.js.map