(sessionID: SessionID, info: Patch)
| 734 | }) |
| 735 | |
| 736 | const patch = (sessionID: SessionID, info: Patch) => |
| 737 | Effect.gen(function* () { |
| 738 | const current = yield* get(sessionID) |
| 739 | const next = { |
| 740 | ...current, |
| 741 | ...info, |
| 742 | time: info.time ? { ...current.time, ...info.time } : current.time, |
| 743 | share: info.share === null ? undefined : info.share ? { ...current.share, ...info.share } : current.share, |
| 744 | summary: info.summary === null ? undefined : (info.summary ?? current.summary), |
| 745 | revert: info.revert === null ? undefined : (info.revert ?? current.revert), |
| 746 | permission: info.permission === null ? undefined : (info.permission ?? current.permission), |
| 747 | } as Info |
| 748 | yield* events.publish(SessionV1.Event.Updated, { sessionID, info: next }) |
| 749 | }) |
| 750 | |
| 751 | const touch = Effect.fn("Session.touch")(function* (sessionID: SessionID) { |
| 752 | yield* patch(sessionID, { time: { updated: Date.now() } }).pipe(Effect.orDie) |
no test coverage detected