import { createDefaultOnPushListItems } from './on-push-list-item.functions' ; import { OnPushList } from './on-push-list.interface' ; const NumberOfItems = 10 ; let nextListId = 0 ; export function createDefaultOnPushLists ( ) { return Array . apply ( null , { length : NumberOfItems } ) . reduce ( lists => addOnPushList ( lists ) , [ ] ) ; } export function addOnPushList ( lists ) { return [ createOnPushList ( ) ] . concat ( lists ) ; } export function removeOnPushList ( lists , listToRemove ) { return lists . filter ( list => list !== listToRemove ) ; } function createOnPushList ( ) { return { id : nextListId ++ , items : createDefaultOnPushListItems ( NumberOfItems ) , } ; }