Feature Request: Add support for eqFn in relation definitions for dynamic matching #37
damienroche
started this conversation in
General
Replies: 1 comment 1 reply
-
This looks good, but I'm not sure about the name of the function. Maybe |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, relations between entities are defined using a declarative structure like the following:
This works well for simple key-to-key equality
(e.g., item.itinerary === target.id)
.However, it becomes limiting when more complex logic is required — for example, when the source entity contains an array of IDs, or when the relation involves custom business logic.
Proposed Enhancement:
Introduce a new field,
eqFn
, as an alternative to theon + eq
pair.eqFn
would allow defining a custom function to determine whether a given item matches a target:Details
eqFn
is exclusive withon
andeq
— wheneqFn
is present, the others are ignored.on
+eq
remains unchanged.What do you think of this feature?
Beta Was this translation helpful? Give feedback.
All reactions