1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular @ngrx/signals SignalStore not working when used inside a library in workspace

Discussão em 'Angular' iniciado por Mauro Alexandre, Outubro 8, 2024.

  1. when using the signal store inside a library and use a nested object we have this errror:

    projects/ltelib/ui-sdk/dashboard/layout/src/store/layout-settings.store.ts:13:14 - error TS2742: The inferred type of 'LayoutSettingsStore' cannot be named without a reference to '../../../../../../../node_modules/@ngrx/signals/src/deep-signal'. This is likely not portable. A type annotation is necessary.

    import { signalStore, withState } from '@ngrx/signals';

    type BooksState = {
    isLoading: boolean;
    filter: { query: string; order: 'asc' | 'desc' };
    };

    const initialState: BooksState = {
    isLoading: false,
    filter: { query: '', order: 'asc' },
    };

    export const LayoutSettingsStore = signalStore(
    withState<BooksState>(initialState)
    );


    this is not my final code, i used to test and its not working.

    If i use the same code but in an app it works peerfectly, but i want to implement in a library.

    Continue reading...

Compartilhe esta Página