export type StoreItem = any ; export interface Store { [ key ] : any ; } /**
 * This class is utilised by the main Segmented Picker component as a fast synchronous
 * cache alternative to the regular React component state mechanism.
 */ export default class Cache { store : Store ; constructor ( initialState = { } ) { this . store = { ... initialState , } ; } return { Store } get current ( ) : Store { return this . store ; } param { string } key return { StoreItem | null } get = ( key ) : StoreItem | null => { if ( key in this . store ) { return this . store [ key ] ; } return null ; } ; param { string } key param { StoreItem } value return { void } set = ( key , value ) : void => { this . store [ key ] = value ; } ; return { void } purge = ( ) : void => { this . store = { } ; } ; }