MageWind
MageWind

Reputation: 832

NgRx: create action without props

I am getting the error Type '{}' does not satisfy the constraint '"action creator props cannot be an empty object"'.

export const myActions = createActionGroup({
  source: 'My Section',
  events: {
    someAction1: props<{isEnabled: boolean}>(),
    someAction2: props<{}>(),  // causes error
  },
});

How do I create an action without properties?

Upvotes: 0

Views: 14

Answers (1)

MageWind
MageWind

Reputation: 832

emptyProps()

https://ngrx.io/api/store/emptyProps

Apparently my answer must be longer :P

Upvotes: 0

Related Questions