Giter Club home page Giter Club logo

Comments (2)

chjj avatar chjj commented on July 18, 2024

Since there is no removeItems method, I've been looping over the items array and removing each one with removeItem, for some reason, looping forward removes only every second item! but, looping in reverse from the last one works fine, for instance...

Because every time you remove and item by index, it gets spliced out, so the items.length changes. If you want to remove all items, you could do list.setItems([]).

I'm okay with a removeItems method. That sounds like a decent idea.

from blessed.

heapwolf avatar heapwolf commented on July 18, 2024

Ah, I didn't think it was a real array (since there was no removeItems
mothod I assumed removeItem was abstracted to prevent the exact problem I
described). Anyway, setItems([]) would kill everything which only addresses
that use case.

On Wednesday, February 26, 2014, Christopher Jeffrey <
[email protected]> wrote:

Since there is no removeItems method, I've been looping over the items
array and removing each one with removeItem, for some reason, looping
forward removes only every second item! but, looping in reverse from the
last one works fine, for instance...

Because every time you remove and item by index, it gets spliced out, so
the items.length changes. If you want to remove all items, you could do
list.setItems([]).

I'm okay with a removeItems method. That sounds like a decent idea.

Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-36176833
.

Paolo Fragomeni
Founder, Here is How
http://hereishow.to

github.com/hij1nx
twitter.com/hij1nx

from blessed.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.