imageUrls = (state = [], action) => {
    const images = state.slice();
    switch(action.type) {
        case t.STORE_URL:
            for(const it of images) {
                if(it.name === action.name)     // image already compressed and exist in store.
                    return images;
            }
            return images.concat({name: action.name, href: action.href, status: 'compressing'});

        case t.UPDATE_COMPRESSED_URL:
            for(const it of images) {
                if(it.name === action.name) {
                    it.size = action.res.bytes;
                    it.status = action.status;
                    it.download_url = action.res.url;
                    it.squashed = action.res.compressedBytes;
                    it.id = action.res.id;     // stored for zip download.
                    return images;
                }
            }
            return state;

        case t.SET_URL_ERROR:
            for(const it of images) {
                if(it.name === action.name) {
                    it.status = action.status;
                    it.error = action.message;
                    return images;
                }
            }
            return state;

        default: return state;
    }
}
error: `Please enter a url`
    - `Url must be valid and start with http(s) only.`
{
    href : '',
    name: '',
    status: '',
    download_url: '',
    squashed: '',
    size: '',
    error: null
}