File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -208,20 +208,19 @@ export default class QueryBuilderGroup extends Vue implements QueryBuilderGroupI
208208 throw new Error (` "initialValue" of "${selectedRule .identifier }" must not be an object - use a factory function! ` );
209209 }
210210
211- let initialValue: any = null ; // null as sensitive default...
212- if (typeof selectedRule .initialValue === ' function' ) {
213- // Use factory function
214- initialValue = selectedRule .initialValue ();
215- }
216-
211+ let value: any = null ; // null as sensitive default...
217212 if (typeof selectedRule .initialValue !== ' undefined' ) {
218- // If it exists use the primitive value
219- ({ initialValue } = selectedRule );
213+ // If a valid has been passed along, use it
214+ value = selectedRule .initialValue ;
215+ }
216+ if (typeof value === ' function' ) {
217+ // initialValue is a factory function
218+ value = value ();
220219 }
221220
222221 children .push ({
223222 identifier: selectedRule .identifier ,
224- value: initialValue ,
223+ value ,
225224 } as Rule );
226225
227226 this .$emit (
You can’t perform that action at this time.
0 commit comments