Skip to content

Conversation

stephencelis
Copy link
Member

// Before:
Reminder.createTemporaryTrigger(afterUpdateTouch: { $0.position += 1 })
// After:
Reminder.createTemporaryTrigger(after: .update { $0.position += 1 })

// Before:
Reminder.createTemporaryTrigger(afterInsertTouch: \.createdAt)
// After:
Reminder.createTemporaryTrigger(after: .insert(touch: \.createdAt))

Notably, the of and when parameters are now available to these helpers so that they can be scoped to certain fields/conditions.

The "touch" helpers have been moved from statics on the table type to
statics on the operation type so that additional customization (like
`on` and `when`) can be surfaced.
@stephencelis stephencelis requested a review from mbrandonw October 6, 2025 21:20
Comment on lines +6 to +11
extension Table {
@available(
*,
deprecated,
message: "Prefer 'createTemporaryTrigger(after: .update(touch:))', instead"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth soft-deprecating, or is the surface minimal enough to push folks to the new APIs sooner?

@stephencelis stephencelis merged commit abb5084 into main Oct 8, 2025
3 checks passed
@stephencelis stephencelis deleted the touch-when branch October 8, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants