Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Jump to Ngxs StateNew to Visual Studio Code? Get it now.
Jump to Ngxs State

Jump to Ngxs State

codeforfun

|
3 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

自用ngxs插件

用于从Action的调用处跳转到Action的实现处。

例如当光标在 welcome.component.ts 文件的 ChangeTestState 这里时按下快捷键后, 就会跳转到 system.state.ts 的这一行 @Action(SystemAction.ChangeTestState) 。

macOS下快捷键为 option+cmd+J,windows下快捷键为 ctrl+alt+;。

welcome.component.ts:

test() {
    this.store.dispatch(new SystemAction.ChangeTestState());
}

system.state.ts:

export interface SystemStateModel {
  testState: number;
}

@State<SystemStateModel>({
  name: 'system',
  defaults: {
    testState: 0,
  },
})
@Injectable({
  providedIn: 'root',
})
export class SystemState {
  @Action(SystemAction.ChangeTestState)
  ChangeTestState(ctx: StateContext<SystemStateModel>) {
    let state = ctx.getState();
    ctx.patchState({testState: state.testState + 1});
  }

}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft