Narvalex / Agrobook

A system for working with agriculture
MIT License
3 stars 1 forks source link

Build an fully guaranteed ordered projection #177

Closed Narvalex closed 6 years ago

Narvalex commented 6 years ago

fromAll() .when({ '$init': (s, e) => { return { 'events': [] }; }, '$any': (s, e) => { let streamId = e.streamId; if (streamId === undefined || streamId === null) return; let category = streamId.split('-')[0];

    switch(category) {
        case 'agrobook.usuarios':
        case 'agrobook.organizaciones':
        case 'agrobook.ap.productores':
        case 'agrobook.ap.contratos':
        case 'agrobook.ap.servicios':
        case 'agrobook.coleccionesDeArchivos':
            //linkTo('agrobookOrderedEvents', e);
            s.events.push(e.data);
            break;
        default:
            return;
    }
}

});

Narvalex commented 6 years ago

Commit 9d3c6a28