Triplit's client storage is split into two areas - an outbox for unsynced updates and a cache for synced updates. Sometimes you may want to indicate that to a user that data has not yet been saved to the server. To do this, you can use the syncStatus method. This method accepts a single sync state (pending, confirmed, all) as an argument.

For example, a messaging app could use two queries to build message sent indicators. In React:

const allMessagesQuery = client.query('messages').order(['createdAt', 'ASC']);
const pendingMessagesQuery = client
function Messages() {
  const { results: allMessages } = useQuery(client, allMessagesQuery);
  const { results: pendingMessages } = useQuery(client, pendingMessagesQuery);
  return (
      {allMessages.entries().map(([id, message]) => (
          <p>{pendingMessages.has(id) ? 'Sending...' : 'Sent'}</p>