import { List } from 'immutable' ; export interface BlockKeyStore { add ( key ) : List < string > ; remove ( key ) : List < string > ; includes ( key ) : boolean ; getAll ( ) : List < string > ; } export default function createBlockKeyStore ( ) { let keys = List < string > ( ) ; return { add ( key ) { keys = keys . push ( key ) ; return keys ; } , remove ( key ) { keys = keys . filter ( ( item ) => item !== key ) as List < string > ; return keys ; } , includes ( key ) { return keys . includes ( key ) ; } , getAll ( ) { return keys ; } , } ; }