VirtualContent
VirtualContent - is a browser tool designed for handling large text/html content.
Installation
npm i --save virtualcontent
Usage
import "VC" from "virtualcontent";
VC.create(options).setText(str).renderTo($container);
Options
| Parameter | Accepts | Default value | Description |
| append | Bool | false | Switch to Append mode (Replace mode is the default) |
| chunkPreProcessor | Function | null | Set function which receives chunk (String) as a first argument, and returns String. |
| delay | Integer | 100 | Delay scroll processing. |
| length | Number | 10240 | Set maximum length for a chunk string |
| scrollableParent | Node/jQueryEl/selector | undefined | Set scrollable parent node. |
| threshold | Number | 2 | It defines how much chunks are shown at once in Replace mode (default) |
API
| Method | Arguments | Returns | Description |
| create (static) | options | New instance | Create new VC instance |
| destroy | none | self | Destroy VC instance |
| renderTo | Node/jQueryEl | self | Render to node or $el |
| setHtml | String | self | Set HTML content |
| setText | String | self | Set text content |