const pagination = createPagination();
const [params, setParams] = createStore<ConstructionCatalogItemListParams>();
const [currentPage, setCurrentPage] = createSignal<Record<string, string>>();
const [itemResource] = createResource(params, constructionCatalogItemList);
createEffect(() => {
// here i am updating my store query params values, these values are coming from pagination context.
setParams((prev: ConstructionCatalogItemListParams) => {
// setCurrentPage is a signal as my plan B, this shouldn't be here if stores worked
console.log("currentPage:", pagination.currentPage());
setCurrentPage({ currentPage: pagination.currentPage().toString() });
return {
...prev,
currentPage: pagination.currentPage(),
};
});
// params was successfully set.
console.log("currentPageParam", params.currentPage);
});
const pagination = createPagination();
const [params, setParams] = createStore<ConstructionCatalogItemListParams>();
const [currentPage, setCurrentPage] = createSignal<Record<string, string>>();
const [itemResource] = createResource(params, constructionCatalogItemList);
createEffect(() => {
// here i am updating my store query params values, these values are coming from pagination context.
setParams((prev: ConstructionCatalogItemListParams) => {
// setCurrentPage is a signal as my plan B, this shouldn't be here if stores worked
console.log("currentPage:", pagination.currentPage());
setCurrentPage({ currentPage: pagination.currentPage().toString() });
return {
...prev,
currentPage: pagination.currentPage(),
};
});
// params was successfully set.
console.log("currentPageParam", params.currentPage);
});