You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A verification function that will check the given value is correct. It is trigger for verifying the initial values, including the default value, and before updated values are applied.
66
+
- If it is set to `none`, all values are allowed.
67
+
- If it is set to a list of values, any given value checks that the new value is in such allowlist.
68
+
- If it is an `mfa`, the given function will be called on the given value. This function
69
+
must be pure and return a boolean or a `{true, NewValue} | {false, Reason}`. It can also be used for preprocessing of the input value by returning `{true, NewValue}`.
70
+
71
+
### `update`
72
+
***Syntax:**`read_only`, `none`, or an `mfa` of arity 2
73
+
***Example:**`update = {?MODULE, update, 2}`
74
+
***Default:**`read_only`
68
75
69
-
A verification function that will check the value given is correct.
70
-
If it is set to `none`, all updates are allowed.
71
-
If it is set to a list of values, any given value checks that the new value is in such whitelist.
72
-
If it is an `mfa`, the given function will be called on the given value. This function
73
-
must be pure and return a boolean or a `{true, NewValue} | {false, Reason}`.
76
+
An action to take when the value of this variable is updated. It is triggered at runtime when updates to the value are applied.
77
+
- If it is set to `read_only`, updates will fail.
78
+
- If it is set to `none`, all updates are allowed.
79
+
- If it is an `mfa`, the given function will be called on the old and new value.
0 commit comments