Skip to content

1.7.0

Choose a tag to compare

@ryupold ryupold released this 13 Dec 14:10
· 159 commits to main since this release
  • add type-safe state context API with Proxy
    Replaces the key based state context with a proxy-based
    implementation to simplify the API and provide a more
    intuitive way to access and manipulate nested state.
    const state = createState<StateType>({
        user: {
            profile: {
                settings: { theme: 'dark', lang: 'es' }
            }
        }
    });
    
    const settingsCtx = context(state).user.profile.settings;
    
    const settings = settingsCtx.get()!; // { theme: 'dark', lang: 'en' }
  • deprecate KeyStateContext (KeyPath) as it lead to a dramatically increased compile time