File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed 
ng-http-caching/src/lib/storage Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -120,23 +120,23 @@ const ngHttpCachingConfig: NgHttpCachingConfig = {
120120};
121121``` 
122122
123- there is also a ` NgHttpCachingLocalStorage `  a cache store with persistence into ` localStorage ` :
123+ there is also a ` withNgHttpCachingLocalStorage `  a cache store with persistence into ` localStorage ` :
124124
125125``` ts 
126- import  { NgHttpCachingConfig , NgHttpCachingLocalStorage  } from  ' ng-http-caching'  ;
126+ import  { NgHttpCachingConfig , withNgHttpCachingLocalStorage  } from  ' ng-http-caching'  ;
127127
128128const   ngHttpCachingConfig:  NgHttpCachingConfig  =  {
129-   store: new   NgHttpCachingLocalStorage (),
129+   store: withNgHttpCachingLocalStorage (),
130130};
131131``` 
132132
133- and a ` NgHttpCachingSessionStorage `  a cache store with persistence into ` sessionStorage ` :
133+ and a ` withNgHttpCachingSessionStorage `  a cache store with persistence into ` sessionStorage ` :
134134
135135``` ts 
136- import  { NgHttpCachingConfig , NgHttpCachingSessionStorage  } from  ' ng-http-caching'  ;
136+ import  { NgHttpCachingConfig , withNgHttpCachingSessionStorage  } from  ' ng-http-caching'  ;
137137
138138const   ngHttpCachingConfig:  NgHttpCachingConfig  =  {
139-   store: new   NgHttpCachingSessionStorage (),
139+   store: withNgHttpCachingSessionStorage (),
140140};
141141``` 
142142
Original file line number Diff line number Diff line change 11import  {  enableProdMode ,  isDevMode  }  from  '@angular/core' ; 
22import  {  bootstrapApplication  }  from  '@angular/platform-browser' ; 
33import  {  AppComponent  }  from  './app/app.component' ; 
4- import  {  NgHttpCachingLocalStorage ,  provideNgHttpCaching  }  from  'projects/ng-http-caching/src/public-api' ; 
4+ import  {  withNgHttpCachingLocalStorage ,  provideNgHttpCaching  }  from  'projects/ng-http-caching/src/public-api' ; 
55import  {  provideHttpClient ,  withInterceptorsFromDi  }  from  '@angular/common/http' ; 
66
77if  ( ! isDevMode ( ) )  { 
@@ -11,7 +11,7 @@ if (!isDevMode()) {
1111bootstrapApplication ( AppComponent ,  { 
1212  providers : [ 
1313    provideNgHttpCaching ( { 
14-       store : new   NgHttpCachingLocalStorage ( ) 
14+       store : withNgHttpCachingLocalStorage ( ) 
1515    } ) , 
1616    provideHttpClient ( withInterceptorsFromDi ( ) ) 
1717  ] 
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ export class NgHttpCachingLocalStorage extends NgHttpCachingBrowserStorage {
66        super ( localStorage ) ; 
77    } 
88} 
9+ 
10+ export  const  withNgHttpCachingLocalStorage  =  ( )  =>  new  NgHttpCachingLocalStorage ( ) ; 
Original file line number Diff line number Diff line change @@ -6,3 +6,5 @@ export class NgHttpCachingSessionStorage extends NgHttpCachingBrowserStorage {
66        super ( sessionStorage ) ; 
77    } 
88} 
9+ 
10+ export  const  withNgHttpCachingSessionStorage  =  ( )  =>  new  NgHttpCachingSessionStorage ( ) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments