For some items (e.g. medication), it would be nice to set an interval that regularly withdraws from the amount of that item. This doesn't require any background running at all, here's how it could work:
- For each item with this behavior, we store:
- Its usage interval
- The last time this interval passed
- How much to use each time the interval passes
- When the app is opened, it uses this information to calculate how much of each item should be removed.
- The "last time used" value is set to the last time the interval passed (which may not be the last time the app was open!)
- If an interval passes while Stockpile is open, it automatically handles the withdrawal.
For some items (e.g. medication), it would be nice to set an interval that regularly withdraws from the amount of that item. This doesn't require any background running at all, here's how it could work:
- For each item with this behavior, we store:
- Its usage interval
- The last time this interval passed
- How much to use each time the interval passes
- When the app is opened, it uses this information to calculate how much of each item should be removed.
- The "last time used" value is set to the last time the interval passed (which may not be the last time the app was open!)
- If an interval passes while Stockpile is open, it automatically handles the withdrawal.