Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store): use strict projectors for createFeature selectors #3799

Commits on Apr 7, 2023

  1. feat(store): use strict projectors for createFeature selectors

    Closes ngrx#3740
    
    BREAKING CHANGES:
    
    Projectors of selectors generated by createFeature are strongly typed.
    
    BEFORE:
    
    Projector function arguments of selectors generated by createFeature are not strongly typed:
    
    ```ts
    const counterFeature = createFeature({
      name: 'counter',
      reducer: createReducer({ count: 0 }),
    });
    
    counterFeature.selectCount.projector
    // type: (...args: any[]) => number
    ```
    
    AFTER:
    
    Projector function arguments of selectors generated by createFeature are strongly typed:
    
    ```ts
    const counterFeature = createFeature({
      name: 'counter',
      reducer: createReducer({ count: 0 }),
    });
    
    counterFeature.selectCount.projector
    // type: (featureState: { count: number; }) => number
    ```
    markostanimirovic committed Apr 7, 2023
    Configuration menu
    Copy the full SHA
    e8a4a4e View commit details
    Browse the repository at this point in the history