I’m working on a view that uses server-sent events to receive log lines from another application and display them in a filterable list. Essentially, the view starts with an empty array as the model, and when the event source receives new log lines, it pushObject
s them into the model. The view iterates over the model and puts each log line in an <li>
element.
Below the list of log lines, there’s an input box that allows the user to filter the logs either by String#indexOf
or via a regular expression. Currently, whenever the value of this input value changes, the controller filters the model by the user input and re-renders the list of log lines.
On a busy app, this can quickly escalate to thousands of lines being filtered. I realize at a certain point, I’ll have to limit the number of lines that can be kept around in the browser to filter, but I’m curious what I can do to stretch that limit as far as possible.