1 line
2.1 KiB
JavaScript
1 line
2.1 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{381:function(t,e,a){"use strict";a.r(e);var v=a(46),n=Object(v.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions","aria-hidden":"true"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("p",[a("a",{attrs:{id:"cache"}})]),t._v(" "),a("h2",{attrs:{id:"const-cache"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#const-cache","aria-hidden":"true"}},[t._v("#")]),t._v(" "),a("code",[t._v("<Const>")]),t._v(" cache")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("cache")]),t._v("(fn: "),a("em",[a("code",[t._v("Function")])]),t._v(", map?: "),a("em",[a("code",[t._v("WeakMap")]),t._v("<"),a("code",[t._v("object")]),t._v(", "),a("code",[t._v("any")]),t._v(">")]),t._v("): "),a("code",[t._v("(Anonymous function)")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/polkadot-js/api/blob/73a5ea1/packages/api-derive/src/util/cache.ts#L23",target:"_blank",rel:"noopener noreferrer"}},[t._v("util/cache.ts:23"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("Create memoization for a 2-currified function.")]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Default value")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("fn")]),t._v(" "),a("td",[a("code",[t._v("Function")])]),t._v(" "),a("td",[t._v("-")]),t._v(" "),a("td",[t._v("The function to memoize.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("Default value")]),t._v(" map")]),t._v(" "),a("td",[a("code",[t._v("WeakMap")]),t._v("<"),a("code",[t._v("object")]),t._v(", "),a("code",[t._v("any")]),t._v(">")]),t._v(" "),a("td",[t._v("new WeakMap()")]),t._v(" "),a("td",[t._v("The Map used to cache function returns.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("code",[t._v("(Anonymous function)")])]),t._v(" "),a("hr")])},[],!1,null,null,null);e.default=n.exports}}]); |