‚̧Nutella Peanut-Butter Marshmallow
    Have ideas to improve npm?Join in the discussion! ¬Ľ

    xlist

    1.0.0¬†‚Äʬ†Public¬†‚Äʬ†Published

    XList

    Samples:

    import xlist from 'xlist';
     
    const todos = xlist(
      { name: 'task 2', done: true },
      { name: 'task 1', done: false },
      { name: 'task 3', done: true }
    );
     
    todos.define('orderByName', { order: { by: x => x.name } });
    todos.define('active', { filter: x => !x.done });
    todos.define('completed', { filter: x => x.done });
     
    console.log('default', todos.get());
     
    console.log('orderByName', todos.get('orderByName'));
     
    console.log('active', todos.get('active'));
     
    console.log('completed', todos.get('completed'));
     
    // remove completed
    todos.remove(x => x.done);
    console.log('completed', todos.get('completed'));
     
    // add task 5
    todos.push({ name: 'task 5', done: true });
    console.log('orderByName', todos.get('orderByName'));

    Install

    npm i xlist

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    33 kB

    Total Files

    13

    Last publish

    Collaborators

    • avatar