Skip to content

v6.0.0

Compare
Choose a tag to compare
@cermakjiri cermakjiri released this 17 Jun 08:35
· 36 commits to master since this release

@ackee/petrus@6.0.0

  • ✅ Migration to TS – strict mode

  • 🎉 Setup typedoc → Auto generated Wiki with API interfaces

  • ✨ Usage example avail. within codesandbox & integrate codesandbox to CI

  • ♻️ Extend PetrusError with type: PetrusErrorType and originalError: Error props & export PetrusErrorType enum and isPetrusError(error: any): boolean util. Example

  • 💥 replace reducerKey with selector function so developer can place petrus reducer at arbitrary depth and path in redux store.

    import { configure } from '@ackee/petrus';
    
    configure({
    -      reducerKey: 'auth',
    +      selector: state => state.auth,  
    })
  • 💥 No more generics at configure method. If you want override internal interfaces (PetrusAppRootState, PetrusUser, PetrusCredentials, PetrusTokens), you can achieve it like this:

    declare module '@ackee/petrus' {
        interface ConfigurePetrusAppRootState {
            value: RootState;
        }
    
        interface ConfigurePetrusUser {
            value: AuthUser;
        }
    
        interface ConfigurePetrusCredentials {
            value: Credentials;
        }
    
        interface ConfigurePetrusTokens {
            value: Tokens;
        }
    }