Frontmatter
| id | 3172 |
| title | Formulas in ViewModel and ViewController |
| state | Closed |
| labels | enhancementstale |
| assignees | [] |
| createdAt | Jun 20, 2022, 11:43 AM |
| updatedAt | Sep 15, 2024, 4:35 AM |
| githubUrl | https://github.com/neomjs/neo/issues/3172 |
| author | Dinkh |
| commentsCount | 2 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Sep 15, 2024, 4:35 AM |
I would like to get an easy way of listening to changes in viewModel Data and Store-configs These should be listened to in formulas in the viewModel and viewController
@example
viewModel
data: { a: 1 }, stores: { mystore: { isLoading: false // config of the current state of the store } } formulas: { b: { bind: {a: 'a'}, get(data => toUppercase(data.a);) }, storeIsLoading: { bind: {isLoading: 'mystore.isLoading', get(data) {return isLoading} } }viewController
formulas: { b: { bind: {a: 'a'}, fn: 'onAChange' }, storeIsLoading: { bind: {isLoading: 'mystore.isLoading', fn: 'onStoreLoadingChange' } }, onAChange(value, oldValue) {}, onStoreLoadingChange(value, oldValue) {}