notrab / react-use-cart

React hook library for managing cart state
http://npm.im/react-use-cart
Apache License 2.0
367 stars 48 forks source link

Missing type for updateCartMetadata [and others (?)] #77

Closed KrallXZ closed 3 years ago

KrallXZ commented 3 years ago

Hey, the package's types definitions have some missing types.

Property 'updateCartMetadata' does not exist on type 'CartProviderState'.

CartProviderState:

export declare const CartProvider: React.FC<{
    children?: React.ReactNode;
    id?: string;
    defaultItems?: Item[];
    onSetItems?: (items: Item[]) => void;
    onItemAdd?: (payload: Item) => void;
    onItemUpdate?: (payload: object) => void;
    onItemRemove?: (id: Item["id"]) => void;
    storage?: (key: string, initialValue: string) => [string, (value: Function | string) => void];
    metadata?: Metadata;
}>;
notrab commented 3 years ago

Hey @KrallXZ

This should be fixed in #75

I'll create a separate PR before though so this can get in now.

notrab commented 3 years ago

Fixed, not yet released. Will be bundled into a fix release over the next few days.

salomaos commented 3 years ago

Hi, any news on this!?

notrab commented 3 years ago

@salomaos if you install from GitHub in the meantime - you should see the type for this added. It'll be bundled into the next release that goes out.