export function debounce ( fn , n = 100 ) { let handle ; return ( ... args ) => { if ( handle ) clearTimeout ( handle ) ; handle = setTimeout ( ( ) => { fn ( ... args ) ; } , n ) ; } ; } export function utoa ( data ) { return btoa ( unescape ( encodeURIComponent ( data ) ) ) ; } export function atou ( base64 ) { return decodeURIComponent ( escape ( atob ( base64 ) ) ) ; }