Count + 1: {commontools_1.derive(state.count, _v1 => _v1 + 1)}
-Count - 1: {commontools_1.derive(state.count, _v1 => _v1 - 1)}
-Count * 2: {commontools_1.derive(state.count, _v1 => _v1 * 2)}
-Price / 2: {commontools_1.derive(state.price, _v1 => _v1 / 2)}
-Count % 3: {commontools_1.derive(state.count, _v1 => _v1 % 3)}
- -Discounted Price: {commontools_1.derive({ state_price: state.price, state_discount: state.discount }, ({ state_price: _v1, state_discount: _v2 }) => _v1 - (_v1 * _v2))}
-Total: {commontools_1.derive({ state_price: state.price, state_quantity: state.quantity }, ({ state_price: _v1, state_quantity: _v2 }) => _v1 * _v2)}
-With Tax (8%): {commontools_1.derive({ state_price: state.price, state_quantity: state.quantity }, ({ state_price: _v1, state_quantity: _v2 }) => (_v1 * _v2) * 1.08)}
-Complex: {commontools_1.derive({ state_count: state.count, state_quantity: state.quantity, state_price: state.price, state_discount: state.discount }, ({ state_count: _v1, state_quantity: _v2, state_price: _v3, state_discount: _v4 }) => (_v1 + _v2) * _v3 - (_v3 * _v4))}
- -Count³: {commontools_1.derive(state.count, _v1 => _v1 * _v1 * _v1)}
-Price Range: ${commontools_1.derive(state.price, _v1 => _v1 - 10)} - ${commontools_1.derive(state.price, _v1 => _v1 + 10)}
-Few items: {state.count}
)} -Max: {commontools_1.derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.max(_v1, _v2))}
-Min: {commontools_1.derive(state.a, _v1 => Math.min(_v1, 10))}
-Abs: {commontools_1.derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.abs(_v1 - _v2))}
-Round: {commontools_1.derive(state.price, _v1 => Math.round(_v1))}
-Floor: {commontools_1.derive(state.price, _v1 => Math.floor(_v1))}
-Ceiling: {commontools_1.derive(state.price, _v1 => Math.ceil(_v1))}
-Square root: {commontools_1.derive(state.a, _v1 => Math.sqrt(_v1))}
- -Uppercase: {commontools_1.derive(state.name, _v1 => _v1.toUpperCase())}
-Lowercase: {commontools_1.derive(state.name, _v1 => _v1.toLowerCase())}
-Substring: {commontools_1.derive(state.text, _v1 => _v1.substring(0, 5))}
-Replace: {commontools_1.derive(state.text, _v1 => _v1.replace("old", "new"))}
-Includes: {commontools_1.ifElse(commontools_1.derive(state.text, _v1 => _v1.includes("test")), "Yes", "No")}
-Starts with: {commontools_1.ifElse(commontools_1.derive(state.name, _v1 => _v1.startsWith("A")), "Yes", "No")}
- -To Fixed: {commontools_1.derive(state.price, _v1 => _v1.toFixed(2))}
-To Precision: {commontools_1.derive(state.price, _v1 => _v1.toPrecision(4))}
- -Parse Int: {commontools_1.derive(state.float, _v1 => parseInt(_v1))}
-Parse Float: {commontools_1.derive(state.float, _v1 => parseFloat(_v1))}
- -Sum: {commontools_1.derive(state.values, _v1 => _v1.reduce((a, b) => a + b, 0))}
-Max value: {commontools_1.derive(state.values, _v1 => Math.max(..._v1))}
-Joined: {commontools_1.derive(state.values, _v1 => _v1.join(", "))}
- -Multiple args: {commontools_1.derive(state.a, _v1 => Math.pow(_v1, 2))}
-Nested calls: {commontools_1.derive(state.a, _v1 => Math.round(Math.sqrt(_v1)))}
-Chained calls: {commontools_1.derive(state.name, _v1 => _v1.trim().toUpperCase())}
-With expressions: {commontools_1.derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.max(_v1 + 1, _v2 * 2))}
-{commontools_1.derive({ state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_firstName: _v1, state_lastName: _v2 }) => _v1 + _v2)}
-{commontools_1.derive(state.firstName, _v1 => "Hello, " + _v1 + "!")}
- -{commontools_1.derive(state.firstName, _v1 => `Welcome, ${_v1}!`)}
-{commontools_1.derive({ state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_firstName: _v1, state_lastName: _v2 }) => `Full name: ${_v1} ${_v2}`)}
-{commontools_1.derive({ state_title: state.title, state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_title: _v1, state_firstName: _v2, state_lastName: _v3 }) => `${_v1}: ${_v2} ${_v3}`)}
- -Uppercase: {commontools_1.derive(state.firstName, _v1 => _v1.toUpperCase())}
-Lowercase: {commontools_1.derive(state.title, _v1 => _v1.toLowerCase())}
-Length: {commontools_1.derive(state.message, _v1 => _v1.length)}
-Substring: {commontools_1.derive(state.message, _v1 => _v1.substring(0, 5))}
- -{commontools_1.derive({ state_firstName: state.firstName, state_count: state.count }, ({ state_firstName: _v1, state_count: _v2 }) => _v1 + " has " + _v2 + " items")}
-{commontools_1.derive({ state_firstName: state.firstName, state_count: state.count }, ({ state_firstName: _v1, state_count: _v2 }) => `${_v1} has ${_v2} items`)}
-Count as string: {commontools_1.derive(state.count, _v1 => "Count: " + _v1)}
-Positive
,Non-positive
)} +Positive
+ :Non-positive
} +Price: {price}
-Discount: {commontools_1.derive({ price, discount }, ({ price: price, discount: discount }) => price - discount)}
-With tax: {commontools_1.derive({ price, discount, tax }, ({ price: price, discount: discount, tax: tax }) => (price - discount) * (1 + tax))}
+Discount: {derive({ price, discount }, ({ price: price, discount: discount }) => price - discount)}
+With tax: {derive({ price, discount, tax }, ({ price: price, discount: discount, tax: tax }) => (price - discount) * (1 + tax))}
Matrix value: {derive({ state_matrix: state.matrix, state_row: state.row, state_col: state.col }, ({ state_matrix: _v1, state_row: _v2, state_col: _v3 }) => _v1[_v2][_v3])}
+ + {/* Triple nested access */} +Deep nested: {derive({ state_nested_arrays: state.nested.arrays, state_nested_index: state.nested.index, state_row: state.row }, ({ state_nested_arrays: _v1, state_nested_index: _v2, state_row: _v3 }) => _v1[_v2][_v3])}
+ +First and last: {state.items[0]} and {derive({ state_items: state.items, state_items_length: state.items.length }, ({ state_items: _v1, state_items_length: _v2 }) => _v1[_v2 - 1])}
+ + {/* Array used in computation and access */} +Sum of ends: {derive({ state_arr: state.arr, state_arr_length: state.arr.length }, ({ state_arr: _v1, state_arr_length: _v2 }) => _v1[0] + _v1[_v2 - 1])}
+ +Computed index: {derive({ state_arr: state.arr, state_a: state.a, state_b: state.b }, ({ state_arr: _v1, state_a: _v2, state_b: _v3 }) => _v1[_v2 + _v3])}
+ + {/* Index from computation involving array */} +Modulo index: {derive({ state_items: state.items, state_row: state.row, state_items_length: state.items.length }, ({ state_items: _v1, state_row: _v2, state_items_length: _v3 }) => _v1[_v2 % _v3])}
+ + {/* Complex index expression */} +Complex: {derive({ state_arr: state.arr, state_a: state.a, state_arr_length: state.arr.length }, ({ state_arr: _v1, state_a: _v2, state_arr_length: _v3 }) => _v1[Math.min(_v2 * 2, _v3 - 1)])}
+ +User score: {derive({ state_users: state.users, state_selectedUser: state.selectedUser, state_selectedScore: state.selectedScore }, ({ state_users: _v1, state_selectedUser: _v2, state_selectedScore: _v3 }) => _v1[_v2].scores[_v3])}
+ + {/* Using one array element as index for another */} +Indirect: {derive({ state_items: state.items, state_indices: state.indices }, ({ state_items: _v1, state_indices: _v2 }) => _v1[_v2[0]])}
+ + {/* Array element used as index for same array */} +Self reference: {derive(state.arr, _v1 => _v1[_v1[0]])}
+ +Mixed: {derive({ state_nested_arrays: state.nested.arrays, state_nested_index: state.nested.index }, ({ state_nested_arrays: _v1, state_nested_index: _v2 }) => _v1[_v2].length)}
+ + {/* Element access followed by property access */} +User name length: {derive({ state_users: state.users, state_selectedUser: state.selectedUser }, ({ state_users: _v1, state_selectedUser: _v2 }) => _v1[_v2].name.length)}
+ +Conditional: {ifElse(derive({ state_arr: state.arr, state_a: state.a }, ({ state_arr: _v1, state_a: _v2 }) => _v1[_v2] > 10), derive({ state_items: state.items, state_b: state.b }, ({ state_items: _v1, state_b: _v2 }) => _v1[_v2]), state.items[0])}
+ + {/* Element access in boolean expression */} +Has value: {ifElse(derive({ state_matrix: state.matrix, state_row: state.row, state_col: state.col }, ({ state_matrix: _v1, state_row: _v2, state_col: _v3 }) => _v1[_v2][_v3] > 0), "positive", "non-positive")}
+ +Product: {derive({ state_arr: state.arr, state_a: state.a, state_b: state.b }, ({ state_arr: _v1, state_a: _v2, state_b: _v3 }) => _v1[_v2] * _v1[_v3])}
+ + {/* Element access with string concatenation */} +Concat: {derive({ state_items: state.items, state_indices: state.indices }, ({ state_items: _v1, state_indices: _v2 }) => _v1[0] + " - " + _v1[_v2[0]])}
+ + {/* Multiple element accesses in single expression */} +Sum: {derive(state.arr, _v1 => _v1[0] + _v1[1] + _v1[2])}
+Matrix value: {state.matrix[state.row][state.col]}
+ + {/* Triple nested access */} +Deep nested: {state.nested.arrays[state.nested.index][state.row]}
+ +First and last: {state.items[0]} and {state.items[state.items.length - 1]}
+ + {/* Array used in computation and access */} +Sum of ends: {state.arr[0] + state.arr[state.arr.length - 1]}
+ +Computed index: {state.arr[state.a + state.b]}
+ + {/* Index from computation involving array */} +Modulo index: {state.items[state.row % state.items.length]}
+ + {/* Complex index expression */} +Complex: {state.arr[Math.min(state.a * 2, state.arr.length - 1)]}
+ +User score: {state.users[state.selectedUser].scores[state.selectedScore]}
+ + {/* Using one array element as index for another */} +Indirect: {state.items[state.indices[0]]}
+ + {/* Array element used as index for same array */} +Self reference: {state.arr[state.arr[0]]}
+ +Mixed: {state.nested.arrays[state.nested.index].length}
+ + {/* Element access followed by property access */} +User name length: {state.users[state.selectedUser].name.length}
+ +Conditional: {state.arr[state.a] > 10 ? state.items[state.b] : state.items[0]}
+ + {/* Element access in boolean expression */} +Has value: {ifElse(state.matrix[state.row][state.col] > 0, "positive", "non-positive")}
+ +Product: {state.arr[state.a] * state.arr[state.b]}
+ + {/* Element access with string concatenation */} +Concat: {state.items[0] + " - " + state.items[state.indices[0]]}
+ + {/* Multiple element accesses in single expression */} +Sum: {state.arr[0] + state.arr[1] + state.arr[2]}
+Item: {derive({ state_items: state.items, state_index: state.index }, ({ state_items: _v1, state_index: _v2 }) => _v1[_v2])}
+ + {/* Computed index */} +Last: {derive({ state_items: state.items, state_items_length: state.items.length }, ({ state_items: _v1, state_items_length: _v2 }) => _v1[_v2 - 1])}
+ + {/* Double indexing */} +Matrix: {derive({ state_matrix: state.matrix, state_row: state.row, state_col: state.col }, ({ state_matrix: _v1, state_row: _v2, state_col: _v3 }) => _v1[_v2][_v3])}
+Item: {state.items[state.index]}
+ + {/* Computed index */} +Last: {state.items[state.items.length - 1]}
+ + {/* Double indexing */} +Matrix: {state.matrix[state.row][state.col]}
+Count + 1: {derive(state.count, _v1 => _v1 + 1)}
+Count - 1: {derive(state.count, _v1 => _v1 - 1)}
+Count * 2: {derive(state.count, _v1 => _v1 * 2)}
+Price / 2: {derive(state.price, _v1 => _v1 / 2)}
+Count % 3: {derive(state.count, _v1 => _v1 % 3)}
+ +Discounted Price: {derive({ state_price: state.price, state_discount: state.discount }, ({ state_price: _v1, state_discount: _v2 }) => _v1 - (_v1 * _v2))}
+Total: {derive({ state_price: state.price, state_quantity: state.quantity }, ({ state_price: _v1, state_quantity: _v2 }) => _v1 * _v2)}
+With Tax (8%): {derive({ state_price: state.price, state_quantity: state.quantity }, ({ state_price: _v1, state_quantity: _v2 }) => (_v1 * _v2) * 1.08)}
+Complex: {derive({ state_count: state.count, state_quantity: state.quantity, state_price: state.price, state_discount: state.discount }, ({ state_count: _v1, state_quantity: _v2, state_price: _v3, state_discount: _v4 }) => (_v1 + _v2) * _v3 - (_v3 * _v4))}
+ +Count³: {derive(state.count, _v1 => _v1 * _v1 * _v1)}
+Price Range: ${derive(state.price, _v1 => _v1 - 10)} - ${derive(state.price, _v1 => _v1 + 10)}
+Total items: {commontools_1.derive(state.items, _v1 => _v1.length)}
-Filtered count: {commontools_1.derive({ state_items: state.items, state_filter: state.filter }, ({ state_items: _v1, state_filter: _v2 }) => _v1.filter(i => i.name.includes(_v2)).length)}
+Total items: {state.items.length}
+Filtered count: {derive({ state_items: state.items, state_filter: state.filter }, ({ state_items: _v1, state_filter: _v2 }) => _v1.filter(i => i.name.includes(_v2)).length)}
Item count: {commontools_1.derive(state.items, _v1 => _v1.length)}
-Active items: {commontools_1.derive(state.items, _v1 => _v1.filter(i => i.active).length)}
+Item count: {state.items.length}
+Active items: {derive(state.items, _v1 => _v1.filter(i => i.active).length)}
Discount percent: {commontools_1.derive(state.discount, _v1 => _v1 * 100)}%
-Tax percent: {commontools_1.derive(state.taxRate, _v1 => _v1 * 100)}%
+Discount percent: {derive(state.discount, _v1 => _v1 * 100)}%
+Tax percent: {derive(state.taxRate, _v1 => _v1 * 100)}%
All active: {commontools_1.ifElse(commontools_1.derive(state.items, _v1 => _v1.every(i => i.active)), "Yes", "No")}
-Any active: {commontools_1.ifElse(commontools_1.derive(state.items, _v1 => _v1.some(i => i.active)), "Yes", "No")}
-Has expensive (gt 100): {commontools_1.ifElse(commontools_1.derive(state.items, _v1 => _v1.some(i => i.price > 100)), "Yes", "No")}
+All active: {ifElse(derive(state.items, _v1 => _v1.every(i => i.active)), "Yes", "No")}
+Any active: {ifElse(derive(state.items, _v1 => _v1.some(i => i.active)), "Yes", "No")}
+Has expensive (gt 100): {ifElse(derive(state.items, _v1 => _v1.some(i => i.price > 100)), "Yes", "No")}
Few items: {state.count}
)} +Max: {derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.max(_v1, _v2))}
+Min: {derive(state.a, _v1 => Math.min(_v1, 10))}
+Abs: {derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.abs(_v1 - _v2))}
+Round: {derive(state.price, _v1 => Math.round(_v1))}
+Floor: {derive(state.price, _v1 => Math.floor(_v1))}
+Ceiling: {derive(state.price, _v1 => Math.ceil(_v1))}
+Square root: {derive(state.a, _v1 => Math.sqrt(_v1))}
+ +Uppercase: {derive(state.name, _v1 => _v1.toUpperCase())}
+Lowercase: {derive(state.name, _v1 => _v1.toLowerCase())}
+Substring: {derive(state.text, _v1 => _v1.substring(0, 5))}
+Replace: {derive(state.text, _v1 => _v1.replace("old", "new"))}
+Includes: {ifElse(derive(state.text, _v1 => _v1.includes("test")), "Yes", "No")}
+Starts with: {ifElse(derive(state.name, _v1 => _v1.startsWith("A")), "Yes", "No")}
+ +To Fixed: {derive(state.price, _v1 => _v1.toFixed(2))}
+To Precision: {derive(state.price, _v1 => _v1.toPrecision(4))}
+ +Parse Int: {derive(state.float, _v1 => parseInt(_v1))}
+Parse Float: {derive(state.float, _v1 => parseFloat(_v1))}
+ +Sum: {derive(state.values, _v1 => _v1.reduce((a, b) => a + b, 0))}
+Max value: {derive(state.values, _v1 => Math.max(..._v1))}
+Joined: {derive(state.values, _v1 => _v1.join(", "))}
+ +Multiple args: {derive(state.a, _v1 => Math.pow(_v1, 2))}
+Nested calls: {derive(state.a, _v1 => Math.round(Math.sqrt(_v1)))}
+Chained calls: {derive(state.name, _v1 => _v1.trim().toUpperCase())}
+With expressions: {derive({ state_a: state.a, state_b: state.b }, ({ state_a: _v1, state_b: _v2 }) => Math.max(_v1 + 1, _v2 * 2))}
+Age: {state.user.age}
-Active: {commontools_1.ifElse(state.user.active, "Yes", "No")}
+Active: {ifElse(state.user.active, "Yes", "No")}
Bio: {state.user.profile.bio}
Location: {state.user.profile.location}
Theme: {state.user.profile.settings.theme}
-Notifications: {commontools_1.ifElse(state.user.profile.settings.notifications, "On", "Off")}
+Notifications: {ifElse(state.user.profile.settings.notifications, "On", "Off")}
Age + 1: {commontools_1.derive(state.user.age, _v1 => _v1 + 1)}
-Name length: {commontools_1.derive(state.user.name, _v1 => _v1.length)}
-Uppercase name: {commontools_1.derive(state.user.name, _v1 => _v1.toUpperCase())}
-Location includes city: {commontools_1.ifElse(commontools_1.derive(state.user.profile.location, _v1 => _v1.includes("City")), "Yes", "No")}
+Age + 1: {derive(state.user.age, _v1 => _v1 + 1)}
+Name length: {state.user.name.length}
+Uppercase name: {derive(state.user.name, _v1 => _v1.toUpperCase())}
+Location includes city: {ifElse(derive(state.user.profile.location, _v1 => _v1.includes("City")), "Yes", "No")}
Item at index: {state.items[state.index.get()]}
+Item at index: {derive({ state_items: state.items, state_index: state.index }, ({ state_items: _v1, state_index: _v2 }) => _v1[_v2])}
First item: {state.items[0]}
-Last item: {state.items[state.items.get().length - 1]}
-Number at index: {state.numbers[state.index.get()]}
+Last item: {derive({ state_items: state.items, state_items_length: state.items.length }, ({ state_items: _v1, state_items_length: _v2 }) => _v1[_v2 - 1])}
+Number at index: {derive({ state_numbers: state.numbers, state_index: state.index }, ({ state_numbers: _v1, state_index: _v2 }) => _v1[_v2])}
+ color: state.config.theme.primaryColor, + fontSize: derive(state.config.theme.fontSize, _v1 => _v1 + "px") + }}> Styled text
{commontools_1.derive({ state_user_name: state.user.name, state_user_profile_location: state.user.profile.location }, ({ state_user_name: _v1, state_user_profile_location: _v2 }) => _v1 + " from " + _v2)}
-Font size + 2: {commontools_1.derive(state.config.theme.fontSize, _v1 => _v1 + 2)}px
-Has beta and dark mode: {commontools_1.ifElse(commontools_1.derive({ state_config_features_beta: state.config.features.beta, state_config_features_darkMode: state.config.features.darkMode }, ({ state_config_features_beta: _v1, state_config_features_darkMode: _v2 }) => _v1 && _v2), "Yes", "No")}
+{derive({ state_user_name: state.user.name, state_user_profile_location: state.user.profile.location }, ({ state_user_name: _v1, state_user_profile_location: _v2 }) => _v1 + " from " + _v2)}
+Font size + 2: {derive(state.config.theme.fontSize, _v1 => _v1 + 2)}px
+Has beta and dark mode: {ifElse(derive({ state_config_features_beta: state.config.features.beta, state_config_features_darkMode: state.config.features.darkMode }, ({ state_config_features_beta: _v1, state_config_features_darkMode: _v2 }) => _v1 && _v2), "Yes", "No")}
{derive({ state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_firstName: _v1, state_lastName: _v2 }) => _v1 + _v2)}
+{derive(state.firstName, _v1 => "Hello, " + _v1 + "!")}
+ +{derive(state.firstName, _v1 => `Welcome, ${_v1}!`)}
+{derive({ state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_firstName: _v1, state_lastName: _v2 }) => `Full name: ${_v1} ${_v2}`)}
+{derive({ state_title: state.title, state_firstName: state.firstName, state_lastName: state.lastName }, ({ state_title: _v1, state_firstName: _v2, state_lastName: _v3 }) => `${_v1}: ${_v2} ${_v3}`)}
+ +Uppercase: {derive(state.firstName, _v1 => _v1.toUpperCase())}
+Lowercase: {derive(state.title, _v1 => _v1.toLowerCase())}
+Length: {state.message.length}
+Substring: {derive(state.message, _v1 => _v1.substring(0, 5))}
+ +{derive({ state_firstName: state.firstName, state_count: state.count }, ({ state_firstName: _v1, state_count: _v2 }) => _v1 + " has " + _v2 + " items")}
+{derive({ state_firstName: state.firstName, state_count: state.count }, ({ state_firstName: _v1, state_count: _v2 }) => `${_v1} has ${_v2} items`)}
+Count as string: {derive(state.count, _v1 => "Count: " + _v1)}
+Trimmed lower: {derive(state.text, _v1 => _v1.trim().toLowerCase())}
+ + {/* Chain with reactive argument */} +Contains search: {derive({ state_text: state.text, state_searchTerm: state.searchTerm }, ({ state_text: _v1, state_searchTerm: _v2 }) => _v1.toLowerCase().includes(_v2.toLowerCase()))}
+ + {/* Longer chain */} +Processed: {derive(state.text, _v1 => _v1.trim().toLowerCase().replace("old", "new").toUpperCase())}
+ +Count above threshold: {derive({ state_items: state.items, state_threshold: state.threshold }, ({ state_items: _v1, state_threshold: _v2 }) => _v1.filter(x => x > _v2).length)}
+ + {/* Filter then map */} +Double filter count: {derive({ state_items: state.items, state_start: state.start, state_end: state.end }, ({ state_items: _v1, state_start: _v2, state_end: _v3 }) => _v1.filter(x => x > _v2).filter(x => x < _v3).length)}
+ +Sliced items: {derive({ state_items: state.items, state_start: state.start, state_end: state.end }, ({ state_items: _v1, state_start: _v2, state_end: _v3 }) => _v1.slice(_v2, _v3).join(", "))}
+ + {/* String methods with reactive args */} +Starts with: {derive({ state_names: state.names, state_prefix: state.prefix }, ({ state_names: _v1, state_prefix: _v2 }) => _v1.filter(n => n.startsWith(_v2)).join(", "))}
+ + {/* Array find with reactive predicate */} +First match: {derive({ state_names: state.names, state_searchTerm: state.searchTerm }, ({ state_names: _v1, state_searchTerm: _v2 }) => _v1.find(n => n.includes(_v2)))}
+ +Total with discount: {derive({ state_prices: state.prices, state_discount: state.discount }, ({ state_prices: _v1, state_discount: _v2 }) => _v1.reduce((sum, price) => sum + price * (1 - _v2), 0))}
+ + {/* Method result used in computation */} +Average * factor: {derive({ state_items: state.items, state_items_length: state.items.length, state_factor: state.factor }, ({ state_items: _v1, state_items_length: _v2, state_factor: _v3 }) => (_v1.reduce((a, b) => a + b, 0) / _v2) * _v3)}
+ +Formatted price: {derive({ state_prices: state.prices, state_discount: state.discount }, ({ state_prices: _v1, state_discount: _v2 }) => (_v1[0] * (1 - _v2)).toFixed(2))}
+ + {/* Method on conditional result */} +Conditional trim: {derive({ state_text: state.text, state_text_length: state.text.length, state_prefix: state.prefix }, ({ state_text: _v1, state_text_length: _v2, state_prefix: _v3 }) => (_v2 > 10 ? _v1 : _v3).trim())}
+ + {/* Method chain on computed value */} +Complex: {derive({ state_text: state.text, state_prefix: state.prefix }, ({ state_text: _v1, state_prefix: _v2 }) => (_v1 + " " + _v2).trim().toLowerCase().split(" ").join("-"))}
+ +Active adults: {derive({ state_users: state.users, state_minAge: state.minAge }, ({ state_users: _v1, state_minAge: _v2 }) => _v1.filter(u => u.age >= _v2 && u.active).length)}
+ + {/* Map with conditional logic */} +Has adults: {ifElse(derive({ state_users: state.users, state_minAge: state.minAge }, ({ state_users: _v1, state_minAge: _v2 }) => _v1.some(u => u.age >= _v2)), "Yes", "No")}
+All active: {ifElse(derive(state.users, _v1 => _v1.every(u => u.active)), "Yes", "No")}
+ +Length sum: {derive({ state_text: state.text, state_prefix: state.prefix }, ({ state_text: _v1, state_prefix: _v2 }) => _v1.trim().length + _v2.trim().length)}
+ + {/* Method result in comparison */} +Is long: {ifElse(derive({ state_text: state.text, state_threshold: state.threshold }, ({ state_text: _v1, state_threshold: _v2 }) => _v1.trim().length > _v2), "Yes", "No")}
+ + {/* Multiple method results combined */} +Joined: {derive({ state_words: state.words, state_separator: state.separator }, ({ state_words: _v1, state_separator: _v2 }) => _v1.join(_v2).toUpperCase())}
+Trimmed lower: {state.text.trim().toLowerCase()}
+ + {/* Chain with reactive argument */} +Contains search: {state.text.toLowerCase().includes(state.searchTerm.toLowerCase())}
+ + {/* Longer chain */} +Processed: {state.text.trim().toLowerCase().replace("old", "new").toUpperCase()}
+ +Count above threshold: {state.items.filter(x => x > state.threshold).length}
+ + {/* Filter then map */} +Double filter count: {state.items.filter(x => x > state.start).filter(x => x < state.end).length}
+ +Sliced items: {state.items.slice(state.start, state.end).join(", ")}
+ + {/* String methods with reactive args */} +Starts with: {state.names.filter(n => n.startsWith(state.prefix)).join(", ")}
+ + {/* Array find with reactive predicate */} +First match: {state.names.find(n => n.includes(state.searchTerm))}
+ +Total with discount: {state.prices.reduce((sum, price) => sum + price * (1 - state.discount), 0)}
+ + {/* Method result used in computation */} +Average * factor: {(state.items.reduce((a, b) => a + b, 0) / state.items.length) * state.factor}
+ +Formatted price: {(state.prices[0] * (1 - state.discount)).toFixed(2)}
+ + {/* Method on conditional result */} +Conditional trim: {(state.text.length > 10 ? state.text : state.prefix).trim()}
+ + {/* Method chain on computed value */} +Complex: {(state.text + " " + state.prefix).trim().toLowerCase().split(" ").join("-")}
+ +Active adults: {state.users.filter(u => u.age >= state.minAge && u.active).length}
+ + {/* Map with conditional logic */} +Has adults: {state.users.some(u => u.age >= state.minAge) ? "Yes" : "No"}
+All active: {state.users.every(u => u.active) ? "Yes" : "No"}
+ +Length sum: {state.text.trim().length + state.prefix.trim().length}
+ + {/* Method result in comparison */} +Is long: {state.text.trim().length > state.threshold ? "Yes" : "No"}
+ + {/* Multiple method results combined */} +Joined: {state.words.join(state.separator).toUpperCase()}
+Count: {count}
-Next: {commontools_1.derive(count, count => count + 1)}
-Double: {commontools_1.derive(count, count => count * 2)}
-Total: {commontools_1.derive(price, price => price * 1.1)}
+Next: {derive(count, count => count + 1)}
+Double: {derive(count, count => count * 2)}
+Total: {derive(price, price => price * 1.1)}
User info: {state.user.name} (age: {state.user.age}, email: {state.user.email})
+ + {/* String concatenation with multiple property accesses */} +Full profile: {derive({ state_user_name: state.user.name, state_user_profile_location: state.user.profile.location, state_user_profile_bio: state.user.profile.bio }, ({ state_user_name: _v1, state_user_profile_location: _v2, state_user_profile_bio: _v3 }) => _v1 + " from " + _v2 + " - " + _v3)}
+ + {/* Arithmetic with multiple properties from same base */} +Age calculation: {derive(state.user.age, _v1 => _v1 * 12)} months, or {derive(state.user.age, _v1 => _v1 * 365)} days
+ +Theme: {state.config.theme.colors.primary} / {state.config.theme.colors.secondary} on {state.config.theme.colors.background}
+ + {/* Fonts from same nested structure */} +Typography: Headings in {state.config.theme.fonts.heading}, body in {state.config.theme.fonts.body}, code in {state.config.theme.fonts.mono}
+ + {/* Mixed depth accesses */} +Config summary: Dark mode {ifElse(state.config.features.darkMode, "enabled", "disabled")} with {state.config.theme.colors.primary} primary color
+ +Deep value: {state.deeply.nested.structure.with.many.levels.value} (count: {state.deeply.nested.structure.with.many.levels.count})
+ + {/* Mixed depth from same root */} +Mixed depths: {state.deeply.nested.structure.with.many.levels.value} in {state.deeply.nested.structure.with.many.levels.count} items
+ +Array info: First has {state.arrays.first.length} items, second has {state.arrays.second.length} items
+ + {/* Nested array access with shared base */} +Nested: {state.arrays.nested[0].items.length} items in first, count is {state.arrays.nested[0].count}
+ + {/* Array and property access mixed */} +First item: {state.arrays.first[0]} (total: {state.arrays.first.length})
+ +Status: {ifElse(state.user.settings.notifications, derive({ state_user_name: state.user.name, state_user_settings_theme: state.user.settings.theme }, ({ state_user_name: _v1, state_user_settings_theme: _v2 }) => _v1 + " has notifications on with " + _v2 + " theme"), derive(state.user.name, _v1 => _v1 + " has notifications off"))}
+ + {/* Computed expression with shared base */} +Spacing calc: {derive({ state_config_theme_spacing_small: state.config.theme.spacing.small, state_config_theme_spacing_medium: state.config.theme.spacing.medium, state_config_theme_spacing_large: state.config.theme.spacing.large }, ({ state_config_theme_spacing_small: _v1, state_config_theme_spacing_medium: _v2, state_config_theme_spacing_large: _v3 }) => _v1 + _v2 + _v3)} total
+ + {/* Boolean expressions with multiple properties */} +Features: {ifElse(derive({ state_config_features_darkMode: state.config.features.darkMode, state_config_features_animations: state.config.features.animations }, ({ state_config_features_darkMode: _v1, state_config_features_animations: _v2 }) => _v1 && _v2), "Full features", "Limited features")}
+ +Formatted: {derive(state.user.name, _v1 => _v1.toUpperCase())} - {derive(state.user.email, _v1 => _v1.toLowerCase())}
+ + {/* Property access and method calls mixed */} +Profile length: {state.user.profile.bio.length} chars in bio, {state.user.profile.location.length} chars in location
+ +User settings: Theme is {state.user.settings.theme} with privacy {state.user.settings.privacy}
+ + {/* Parent and child both used */} +Data summary: {state.data.items.length} items with average {state.data.totals.average}
+ + {/* Multiple levels of the same chain */} +Nested refs: {state.config.theme.colors.primary} in {state.config.theme.fonts.body} with {ifElse(state.config.features.animations, "animations", "no animations")}
+ +All levels: + Root: {ifElse(state.deeply, "exists", "missing")}, + Nested: {ifElse(state.deeply.nested, "exists", "missing")}, + Value: {state.deeply.nested.structure.with.many.levels.value} +
+User info: {state.user.name} (age: {state.user.age}, email: {state.user.email})
+ + {/* String concatenation with multiple property accesses */} +Full profile: {state.user.name + " from " + state.user.profile.location + " - " + state.user.profile.bio}
+ + {/* Arithmetic with multiple properties from same base */} +Age calculation: {state.user.age * 12} months, or {state.user.age * 365} days
+ +Theme: {state.config.theme.colors.primary} / {state.config.theme.colors.secondary} on {state.config.theme.colors.background}
+ + {/* Fonts from same nested structure */} +Typography: Headings in {state.config.theme.fonts.heading}, body in {state.config.theme.fonts.body}, code in {state.config.theme.fonts.mono}
+ + {/* Mixed depth accesses */} +Config summary: Dark mode {state.config.features.darkMode ? "enabled" : "disabled"} with {state.config.theme.colors.primary} primary color
+ +Deep value: {state.deeply.nested.structure.with.many.levels.value} (count: {state.deeply.nested.structure.with.many.levels.count})
+ + {/* Mixed depth from same root */} +Mixed depths: {state.deeply.nested.structure.with.many.levels.value} in {state.deeply.nested.structure.with.many.levels.count} items
+ +Array info: First has {state.arrays.first.length} items, second has {state.arrays.second.length} items
+ + {/* Nested array access with shared base */} +Nested: {state.arrays.nested[0].items.length} items in first, count is {state.arrays.nested[0].count}
+ + {/* Array and property access mixed */} +First item: {state.arrays.first[0]} (total: {state.arrays.first.length})
+ +Status: {state.user.settings.notifications ? + state.user.name + " has notifications on with " + state.user.settings.theme + " theme" : + state.user.name + " has notifications off"}
+ + {/* Computed expression with shared base */} +Spacing calc: {state.config.theme.spacing.small + state.config.theme.spacing.medium + state.config.theme.spacing.large} total
+ + {/* Boolean expressions with multiple properties */} +Features: {state.config.features.darkMode && state.config.features.animations ? "Full features" : "Limited features"}
+ +Formatted: {state.user.name.toUpperCase()} - {state.user.email.toLowerCase()}
+ + {/* Property access and method calls mixed */} +Profile length: {state.user.profile.bio.length} chars in bio, {state.user.profile.location.length} chars in location
+ +User settings: Theme is {state.user.settings.theme} with privacy {state.user.settings.privacy}
+ + {/* Parent and child both used */} +Data summary: {state.data.items.length} items with average {state.data.totals.average}
+ + {/* Multiple levels of the same chain */} +Nested refs: {state.config.theme.colors.primary} in {state.config.theme.fonts.body} with {state.config.features.animations ? "animations" : "no animations"}
+ +All levels: + Root: {state.deeply ? "exists" : "missing"}, + Nested: {state.deeply.nested ? "exists" : "missing"}, + Value: {state.deeply.nested.structure.with.many.levels.value} +
+Current value: {cell.value}
-Next value: {commontools_1.derive(cell.value, _v1 => _v1 + 1)}
-Double: {commontools_1.derive(cell.value, _v1 => _v1 * 2)}
+Next value: {derive(cell.value, _v1 => _v1 + 1)}
+Double: {derive(cell.value, _v1 => _v1 * 2)}
Value: {commontools_1.derive(cell, cell => cell.value)}
+Value: {cell.value}
Doubled: {doubled}
No charms
,Loaded charms
)} +