Closed karthik-hr closed 7 months ago
Hey @karthik-hr , usually the logic is simple: whatever is declared higher up, is accessible lower down.
That said, this list is in the order the Kea v2 -> v3 automatic codegen arranges things, and can act as a guide:
const supportedProperties = {
props: 'kea',
key: 'kea',
path: 'kea',
connect: 'kea',
actions: 'kea',
defaults: 'kea',
loaders: 'kea-loaders',
forms: 'kea-forms',
subscriptions: 'kea-subscriptions',
windowValues: 'kea-window-values',
reducers: 'kea',
selectors: 'kea',
sharedListeners: 'kea',
thunks: 'kea-thunk',
listeners: 'kea',
start: ['kea-saga', 'saga'],
stop: ['kea-saga', 'cancelled'],
saga: 'kea-saga',
workers: 'kea-saga',
takeEvery: 'kea-saga',
takeLatest: 'kea-saga',
actionToUrl: 'kea-router',
urlToAction: 'kea-router',
events: 'kea',
}
Can you share us recommended way of writing following inside kea([])? 1) events 2) afterMount 3) beforeUnmount 4) actions 5) listeners 6) sharedListeners 7) reducers 8) selectors 9) loaders from kea-loaders 10) defaults 11) path 12) connect 13) keys etc
I encountered init inside listeners() not been called when afterMount is above listeners(). similarly sharedListeners.doSomething is undefined inside listeners() when sharedListeners() placed after listeners()