[docs] Plugins can set up and maintain state doesn't work #7043
              
  
  Closed
              
          
                  
                    
                      fmasion
                    
                  
                
                  announced in
                Frequently Asked
              
            Replies: 5 comments 1 reply
-
| Did you add  | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
        
          
            
              This comment was marked as spam.
            
          
            
        
      
    
            
              This comment was marked as spam.
            
          
            
        
        
          
            
              This comment was marked as spam.
            
          
            
        
      
    
            
              This comment was marked as spam.
            
          
            
        
        
          
            
              This comment was marked as spam.
            
          
            
        
      
    
            
              This comment was marked as spam.
            
          
            
        
        
          
            
              This comment was marked as spam.
            
          
            
        
      
    
            
              This comment was marked as spam.
            
          
            
        
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
In the documentation, page https://tauri.app/fr/v1/guides/features/plugin/, there is an example teaching how to create a plugin, using the plugin::Builder, that manages state :
Here it is :
pub fn init<R: Runtime>() -> TauriPlugin<R> { Builder::new("awesome") .invoke_handler(tauri::generate_handler![do_something]) .setup(|app_handle| { // setup plugin specific state here app_handle.manage(MyState::default()); Ok(()) }) .build() }Sadly,
app_handledoesn't have anymanage()method anymore...I found out that I can manage my plugin state in the app builder directly...
It works, but the app should not be aware of the plugin's state (imho). So I assume it should be a better way to do it.
Thanx for help
Fred
Beta Was this translation helpful? Give feedback.
All reactions