"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.usePostCollection = void 0;
var _tsSdkReactNative = require("@amityco/ts-sdk-react-native");
var _useReactQueryLiveCollection = require("../useReactQueryLiveCollection");
var _constants = require("../../../../core/constants");
const usePostCollection = ({
  params,
  enabled = true
}) => {
  const query = (0, _useReactQueryLiveCollection.useLiveCollection)({
    key: [_constants.QUERY_KEY.POSTS_COLLECTION, JSON.stringify(params)],
    params,
    fetcher: _tsSdkReactNative.PostRepository.getPosts,
    enabled
  });
  return {
    ...query,
    posts: query.data
  };
};
exports.usePostCollection = usePostCollection;
//# sourceMappingURL=usePostCollection.js.map