@postrun/react 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -889,12 +889,18 @@ function useCreatePost(profileId) {
889
889
  },
890
890
  queryClient
891
891
  );
892
+ const post = mutation.data;
892
893
  return {
893
894
  create: mutation.mutateAsync,
894
895
  isPending: mutation.isPending,
895
896
  error: mutation.error,
896
- data: mutation.data,
897
+ data: post,
897
898
  reset: mutation.reset,
899
+ // Derived publish outcome (see the JSDoc above) — `undefined`/`false`/`[]`
900
+ // until the first create resolves; computed from the returned post only.
901
+ status: post?.status,
902
+ isPublished: post ? js.isPublished(post) : false,
903
+ failedVariants: post ? js.failedVariants(post) : [],
898
904
  // The profile's connections must load before `create` can resolve a channel;
899
905
  // gate on this so a call during loading isn't mislabeled "not connected".
900
906
  isReady: connections.isSuccess,