Skip to content

Error in StandardAction generic type definition ? #148

Open
@skurgansky-sugarcrm

Description

@skurgansky-sugarcrm

current type definitions version

export type Action<
  Type extends string = string,
  Payload extends Object = undefined,
  Meta extends Object = undefined
> =
  | ErroneousAction<Type, Meta>
  | (StandardAction<Type, Payload, Meta> & { error?: false });

error:

Argument of type 'ActionMeta<IReceiveContactPayload, IPersistMetadata>' is not assignable to parameter of type 'ArgumentAction<string, undefined, undefined>'.
  Type 'ActionMeta<IReceiveContactPayload, IPersistMetadata>' is not assignable to type 'ActionBasis<string> & Partial<ActionBasis<string> & { payload: object; } & { meta: object; } & { error?: false; }>'.
    Type 'ActionMeta<IReceiveContactPayload, IPersistMetadata>' is not assignable to type 'Partial<ActionBasis<string> & { payload: object; } & { meta: object; } & { error?: false; }>'.
      Types of property 'error' are incompatible.
        Type 'boolean' is not assignable to type 'false'.ts(2345)

i think it should be (StandardAction<Type, Payload, Meta> & { error?: boolean }); ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions