Package Exports
- iauction
- iauction/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (iauction) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
iAuction
Helps you watch your countdown
Installation
Using NPM:
npm install iauctionUsing Yarn:
yarn add iauctionUsage
// basic
const iauction = require("iauction")
...
iauction({
countdownInMin: 1,
startDate: "2022/04/26 17:30:00",
endDate: "2022/04/26 17:30:00",
callback: (time) => console.log(time),
});
// UNIX date
iauction({
countdownInMin: 2,
startDate: 1650974160000,
endDate: 1650974400000,
callback: (time) => console.log(time),
});
// e.g React JS
import iauction from "iauction"
...
useEffect(() => {
iauction({
countdownInMin: 1,
startDate: "2022/04/26 17:33:00",
endDate: "2022/04/26 17:33:00",
callback: (time) => console.log(time),
// time ~ { start: [bool], time: [string], reps: [integer] }
});
}, [])| Parameters | Value type | Description | Information |
|---|---|---|---|
countdownInMin |
integer |
set your timer interface, it will affect to your callback | default 2 |
startDate |
string |
when to start, basically the timer always do their job, but start and reps will tell you is the status was start (boolean) and how many repetition (reps) left until the status start change to true |
use your local time and set with the format (YYYY-MM-DD HH:mm:ss) this will be convert to universal time in the system |
endDate |
string |
when the countdown should stop and don't call your callback again |
use your local time and set with the format (YYYY-MM-DD HH:mm:ss) this will be convert to universal time in the system |
callback |
function |
this function will return the { start: [boolean], time: [string], reps: [integer] } |
start: indicates is now time to start?, time: indicates the countdown, reps: how many repetition has been through from startDate |
Why iAuction?
iauction helps you to watch your countdown and set the start and end datetime easier by using your local time.
iauction methods are great for:
- Handling auction such dutch auction for NFT
- Handling common auction
Support this package by adding features 🏏
Steps:
- Create feature on your local machine and make sure it's work
- Don't forget to put documentation and also test case to help me use your feature
- Make a request from your branch ([username]-[feature_name]) to branch features
✏️ notes: please create your branch by following this format: ([username]-[feature_name])