8
new BaseListState<BrandCriteria, Brand>()

This is working and I add

export type BrandListState = BaseListState<BrandCriteria, Brand>;

then

new BrandListState()

This is not allowed. Any way to fix this problem?

1
  • 1
    You've only declared a type. To new it, you need to have a constructor, too. Have a look at the error 'classes' in the RxJS codebase. They have both a type and a ctor: github.com/ReactiveX/rxjs/blob/… Commented May 5, 2020 at 7:09

1 Answer 1

6

You're using a Type Alias (see doco here) which doesn't have constructor, so it can't be created with new. You need to create class for this

class BrandListState extends BaseListState<BrandCriteria, Brand> {}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.