Comment

Comment by alex7734

But why spend so much time to make it worse?

    on_click() {
        if (last_one()) alert('You must keep at least one item selected.');
        else actually_toggle_it_off();
    }
Simple. Does not need fancy code. User immediately knows what he has to do, with no thinking required.
parent alex7734 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton