I noticed that queries defined with defineQuery are not refreshed when the composable returned by defineQuery is called (for example on component mount). Indeed, since, in the case of a defined query, the setup function is only called once (at initiation of the defined query), the queries called inside the setup function are not called again when this composable is reused.
Therefore, in this PR I am testing an idea to address this, which consists in registering (in the defineQueryMap) the queries which are called by the setup function in order to refresh them when the defineQuery output composable is called.
I noticed that queries defined with
defineQuery
are not refreshed when the composable returned bydefineQuery
is called (for example on component mount). Indeed, since, in the case of a defined query, the setup function is only called once (at initiation of the defined query), the queries called inside the setup function are not called again when this composable is reused.Therefore, in this PR I am testing an idea to address this, which consists in registering (in the
defineQueryMap
) the queries which are called by the setup function in order to refresh them when the defineQuery output composable is called.⚠️ Important note: since the queries are registered by registering the queries called while the setup function is running (cf https://github.com/posva/pinia-colada/pull/40/files#diff-ac8c2f7434eefb694c9ead0745e4cd8297e90afe0a9a4c5ba4a54586c7e8596cR195), the current implementation implies that the setup function must be synchronous.