Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions www/blog/_posts/2024-10-03-memoization-in-hmpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The main disadvantage, of course, is the extra allocation of memory for storing
Since HTML is a template language for displaying the user interface from the server to the client, http requests will need to be memorized. Accordingly, the intended result will be the preservation of HTML markup. Here is an example of how HMPL works:

```javascript
const newDiv = compile(
const newDiv = hmpl.compile(
`<div>
<button>Get the square root of 256</button>
<div>{% raw %}{{ src: "/api/getTheSquareRootOf256", after: "click:button" }}{% endraw %}</div>
Expand All @@ -88,7 +88,7 @@ So, the problem with previous versions is that a new element was constantly put
Specifically to optimize this process, an additional field was introduced, which is called `memo`.

```javascript
const newDiv = compile(
const newDiv = hmpl.compile(
`<div>
<button>Get the square root of 256</button>
<div>{% raw %}{{ src: "/api/getTheSquareRootOf256", memo:true, after: "click:button" }}{% endraw %}</div>
Expand Down
Loading