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

[Feature] - advance Live templates - autocomplete #30

Closed
dinbtechit opened this issue Oct 10, 2023 · 1 comment
Closed

[Feature] - advance Live templates - autocomplete #30

dinbtechit opened this issue Oct 10, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dinbtechit
Copy link
Owner

Live Templates (anywhere within the state class - ctrl + space to autocomplete)

@Actions (){...}

  1. Create action
methodName-ClassName-action

generated Code:

  @Action(ClassName)
  methodName({ patchState }: StateContext<MyStoreStateModel>) {
      // TODO - Implement action
  }
  1. create action with payload
methodName-ClassName-action-payload

generated code:

  @Action(ClassName)
  methodName({ patchState }: StateContext<MyStoreStateModel>, payload: ClassName) {
      // TODO - Implement action
  }
  1. create action with payload with parameters
getUser-User-userid:string,userName?:string-action-payload

generated code:
*.state.ts

  @Action(User)
  getUser({ patchState }: StateContext<MyStoreStateModel>, payload: User) {
      // TODO - Implement action
  }

*.action.ts

export class User {
  static readonly type = '[my-store] User';
  constructor(public userId: string, public userName: string) {
  }

}

@Selectors(){...}

  1. create meta selector
methodName-selector-meta
 @Selector()
  static methodName(state: MyStoreStateModel) {
    return state;
  }
  1. create selector
methodName-selector
 @Selector([])
  static methodName(state: MyStoreStateModel) {
    return state;
  }
@dinbtechit dinbtechit added the enhancement New feature or request label Oct 10, 2023
dinbtechit added a commit that referenced this issue Oct 10, 2023
dinbtechit added a commit that referenced this issue Oct 10, 2023
dinbtechit added a commit that referenced this issue Oct 15, 2023
@dinbtechit
Copy link
Owner Author

Fixed in v0.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant