Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: allow state.signal() to accept more than one field in order to increase the depth of selection #1659

@eneajaho

Description

@eneajaho
interface State {
  movies: {
   data: Movie[];
   loading: boolean;
  }
}

state = rxState<State>(({ set }) => {
   set({ movies: { data: [], loading: false }})
});

// in order to get movie loading we can do only 

moviesLoading = this.state.computed(s => s.movies().loading);

// I want to be able to do
moviesLoading = this.state.signal('movies.loading');
// or
moviesLoading = this.state.signal('movies', 'loading');
// or
moviesLoading = this.state.signal(['movies', 'loading']);

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions