import React from 'react' ; import { BlocksPersistenceWriter } from "./FirestoreBlocksStoreMutations" ; import { BlocksStoreMutations } from "../store/BlocksStoreMutations" ; import IBlocksStoreMutation = BlocksStoreMutations . IBlocksStoreMutation ; import { useFirestoreBlocksPersistenceWriter } from "./FirestoreBlocksPersistenceWriter" ; const IS_NODE = typeof window === 'undefined' ; function createMockBlocksPersistenceWriter ( ) { return async ( mutations ) => { } ; } export function useBlocksPersistenceWriter ( ) { if ( IS_NODE ) { return createMockBlocksPersistenceWriter ( ) ; } return useFirestoreBlocksPersistenceWriter ( ) ; }