import { Draft } from 'immer' ; import { PayloadAction } from '@reduxjs/toolkit' ; import { DecryptResultPmcrypto } from 'pmcrypto' ; import { AttachmentsState } from './attachmentsTypes' ; export const globalReset = ( state ) => { Object . keys ( state ) . forEach ( ( key ) => delete state [ key ] ) ; } ; export const setAttachment = ( state , { payload : { ID , attachment } } ) => { state [ ID ] = attachment ; } ;