Frontmatter
| id | 3158 |
| title | ViewModel Store listener points to Controller method |
| state | Closed |
| labels | enhancement |
| assignees | [] |
| createdAt | Jun 15, 2022, 5:53 PM |
| updatedAt | Jun 16, 2022, 8:54 PM |
| githubUrl | https://github.com/neomjs/neo/issues/3158 |
| author | Dinkh |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jun 16, 2022, 8:54 PM |




I would like to add a listener to the ViewModel as a string. The string represents the method inside the ViewController / parent ViewController.
@example
ViewModel
data: { userData_: {id: 4} // _ (Underscore) at end ==> onUserDataChange method in controller }, stores: { main: { module: MainStore, listeners: { load: 'onMainStoreLoad' // string => method in ViewController } } }ViewController
onUserDataChange(oldData, newData) {doYourStuff} onMainStoreLoad(store, ...originalEvent) {doYourStuff}