@@ -2,7 +2,7 @@ import { defineStore } from 'pinia';
22import  {  ref  }  from  'vue' ; 
33import  md5  from  'md5' ; 
44
5- import  type  IIcon  from  '@/types/icon' ; 
5+ import  type  {   IIcon   }  from  '@/types/icon' ; 
66
77const  baseUrl  =  'https://upload.wikimedia.org/wikipedia/commons' ; 
88
@@ -16,25 +16,25 @@ function loadImage(url: string): Promise<HTMLImageElement> {
1616} 
1717
1818export  const  useIconStore  =  defineStore ( 'icon' ,  ( )  =>  { 
19-   const  icons  =  ref < Record < string ,  IIcon   |   null > > ( { } ) ; 
19+   const  icons  =  ref < Record < string ,  IIcon > > ( { } ) ; 
2020
21-   function  patch ( name : string ,  icon : IIcon   |   null ) : void { 
21+   function  patch ( name : string ,  icon : IIcon ) : void { 
2222    icons . value  =  { 
2323      ...icons . value , 
2424      [ name ] : icon , 
2525    } ; 
2626  } 
2727
2828  function  fetching ( name : string ) : void { 
29-     patch ( name ,  null ) ; 
29+     patch ( name ,  {   status :  'loading'   } ) ; 
3030  } 
3131
3232  function  fetched ( name : string ,  data : string )  { 
33-     patch ( name ,  {  data,  ratio : 1  } ) ; 
33+     patch ( name ,  {  status :  'ready' ,   data,  ratio : 1  } ) ; 
3434  } 
3535
3636  function  failed ( name : string ) : void { 
37-     patch ( name ,  null ) ; 
37+     patch ( name ,  {   status :  'failed'   } ) ; 
3838  } 
3939
4040  function  resolved ( name : string ,  ratio : number )  { 
0 commit comments