import { deleteData, entries } from '../../utils/data.utils';
export const deckEntries = async (_userId) => entries({ startsWith: '/decks/', notContains: '/slides/' });
export const deleteDeck = async (deckId) => deleteData({ key: `/decks/${deckId}` });
// Backwards compatibility with current publish mask in studio and Firebase support. In case of IC we actually do not need a snapshot, publish is synchronous on the client side.
export const snapshotDeck = async ({ onNext }) => {
  document.addEventListener('deckPublished', async ({ detail }) => await onNext(detail), { passive: true });
  return () => document.removeEventListener('deckPublished', ({ detail }) => onNext(detail), false);
};
