param initialValue example returns export default function singleton < T > ( initialValue ) { let value = initialValue ; const setValue = ( newValue ) => { value = newValue ; return value ; } ; const getValue = ( ) => { return value ; } ; return [ getValue , setValue ] as const ; }