typescript 1stores.ts

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript 1stores.ts相关的知识,希望对你有一定的参考价值。

// movies.store.ts
export interface State extends EntityState<Movie> {}

@StoreConfig({ name: 'movies' })
export class MoviesStore extends EntityStore<State, Movie> {
  constructor() {
    super();
  }
}

// actors.store.ts
export interface State extends EntityState<Actor> {}

@StoreConfig({ name: 'actors' })
export class ActorsStore extends EntityStore<State, Actor> {
  constructor() {
    super();
  }
}

// genres.store.ts
export interface State extends EntityState<Genre> {}

@StoreConfig({ name: 'genres' })
export class GenresStore extends EntityStore<State, Genre> {
  constructor() {
    super();
  }
}

// movies.query.ts
export class MoviesQuery extends QueryEntity<State, Movie> {
  constructor(protected store: MoviesStore) {
    super(store);
  }
}


// actors.query.ts
export class ActorsQuery extends QueryEntity<State, Actor> {
  constructor(protected store: ActorsStore) {
    super(store);
  }
}

// genres.query.ts
export class GenresQuery extends QueryEntity<State, Genre> {
  constructor(protected store: GenresStore) {
    super(store);
  }
}

以上是关于typescript 1stores.ts的主要内容,如果未能解决你的问题,请参考以下文章

typescript TypeScript Snippets #typescript

TypeScript入门五:TypeScript的接口

TypeScript系列教程--初探TypeScript

TypeScript入门三:TypeScript函数类型

typescript使用 TypeScript 开发 Vue 组件

认识 TypeScript