NetanelBasal
9/12/2018 - 5:38 AM

1.8-11.ts

import { increment } from '@datorama/akita';

this.peopleStore.update(id, person => ({
  guests: increment(person.guests)
}));

this.peopleStore.update(id, person => ({
  guests: increment(person.guests, { maxValue: 10 })
}));
import { decrement } from '@datorama/akita';

this.peopleStore.update(id, person => ({
  guests: decrement(person.guests)
}));

this.peopleStore.update(id, person => ({
  guests: decrement(person.guests, { allowNegative: true })
}));