npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

addtocart-mini-app

v0.6.2

Published

Add to cart mini-app

Downloads

2

Readme

ADD TO CART Mini-app

My Image

Changelogs

- v0.6.2 - Patch Release (Cart sort)
- v0.5.2 - New feature (mobile responsive)
- v0.4.2 - Patch Release (state not updated)
- v0.4.1 - Add readme image
- v0.3.1 - Empty cart added
- v0.2.1 - Adding props
- v0.1.1 - Adding redux
- v0.0.1 - Adding cart and card components

Installation

npm i addtocart-mini-app

react 18 higher

npm i addtocart-mini-app --legacy-peer-deps

Usage


import {Cart } from "addtocart-mini-app"
const dataLoad = {
  data:[
    {
      id: 1,
      title: "Product 1",
      description: "Best headphone",
      price: 120.00,
      quantity: 3,
      dateAdded: "Fri Oct 28 2022 12:33:52 GMT+0800 (Philippine Standard Time)",
      image: "https://i.pinimg.com/originals/0d/86/b1/0d86b14bb6503907498ebff62062ae12.png"
  },
  {
      id: 2,
      dateAdded: "Fri Oct 28 2022 12:33:01 GMT+0800 (Philippine Standard Time)",
      title: "Product 2",
      description: "Best headphone 2",
      price: 100.00,
      quantity: 1,
      image: "https://www.nicepng.com/png/detail/151-1512944_red-headphone-png-image-background-beats-by-dr.png"
  }
  ]
}
const dataIn = {
    action:{
      shoplink: () => alert("go to shop"),
      decreaseQty: (i:any) => alert(`decrease quantity of item with the id of ${i}` ),
      increaseQty: (i:any) => alert(`increase quantity of item with the id of ${i}` ),
      removeItems: (i:any) => alert(`remove this item with the id of ${i}`)
    }
}
function App() {
  return (
    <div className="">
      <Cart dataLoad={dataLoad} dataIn={dataIn} data={(i) => console.log(i)}/>
    </div>
  );
}

export default App;

Props

| Props | Types| Default Value | Required | Description | | ------------- | ------------- | ------------- | ------------- | ------------- | | dataOut | Function | None | True | Dataout will handle the next action after clicking checkout | | dataIn | Object | None | True | Object with action object that will handle shoplink, decreaseQty, increaseQty, removeItems | | shoplink | Function | None | True | This will handle to go back to shop | | decreaseQty | Function | None | True | This will handle the minus button in a cart, use this to update the quantity of the item in state | | increaseQty | Function | None | True | This will handle the plus button in a cart, use this to update the quantity of the item in state | | removeItems | Function | None | True | This will handle the remove item in a cart, use this to to remove item from a cart using redux | | dataLoad | Array of object | None | True | Initial data of a cart |

Node Version

v16.15.0

Peer Dependecies

"react": "^17.0.2",
"react-dom": "^17.0.2"