UNPKG

atomico-use-remark

Version:
3 lines (2 loc) 1.1 kB
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("atomico"),require("unified"),require("remark-parse"),require("remark-rehype"),require("hast-to-hyperscript")):"function"==typeof define&&define.amd?define(["exports","atomico","unified","remark-parse","remark-rehype","hast-to-hyperscript"],r):r((e||self).atomicoUseRemark={},e.atomico,e.unified,e.remarkParse,e.remarkRehype,e.hastToHyperscript)}(this,function(e,r,i,t,u,n){function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/o(t),a=/*#__PURE__*/o(u),f=function(){Object.assign(this,{Compiler:function(e){return n.toH(r.h,e)}})},p={remarkPlugins:[],rehypePlugins:[]};e.useRemark=function(e,t){void 0===e&&(e=""),void 0===t&&(t=p);var u=r.useState(e),n=u[0],o=u[1],c=r.useMemo(function(){return i.unified().use(s.default).use(t.remarkPlugins||p.remarkPlugins).use(a.default).use(t.rehypePlugins||p.rehypePlugins).use(f)},[JSON.stringify(t)]),m=r.useMemo(function(){return c.processSync(n)},[c,n]);return[m.result,o,m]}}); //# sourceMappingURL=atomico-use-remark.umd.js.map