-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
It's not unusual to need to do additional transformation on data before considering it ingestible by a db or other system. A classic example is needing to trim user input before using it for e.g. a name. The proposal here is to allow a data transformer to be attached to a field; in this case, it seems like map might be a good metaphor:
val nameField = field[String](".selector").map(_.trim) // => a field that trims its valuesThis also introduces the question of whether field should always default to String and allow using map to do data transformation to another type… For example:
val thingField = field(".thing-id").map(Thing.findById) // => field[Thing]I suppose this is might be making fields functors, but I also may not know what I'm talking about…
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels