I hereby claim:
- I am SirM2z on github.
- I am coolm_z (https://keybase.io/coolm_z) on keybase.
- I have a public key whose fingerprint is B055 BC1A BD57 C6EF 6D66 5608 3B45 0968 C69D 4172
To claim this, I am signing this object:
const PENDING = 'pending'; | |
const FULFILLED = 'fulfilled'; | |
const REJECTED = 'rejected'; | |
function Promise(executor) { | |
let self = this; | |
self.status = PENDING; | |
self.onFulfilled = [];//成功的回调 | |
self.onRejected = []; //失败的回调 | |
//PromiseA+ 2.1 | |
function resolve(value) { |
const PENDING = "pending"; | |
const RESOLVED = "resolved"; // fulfilled | |
const REJECTED = "rejected"; //rejected | |
class Promise { | |
// 构造函数接受一个执行器作为参数 | |
constructor(executor) { | |
// promise 状态 | |
this.status = PENDING; | |
this.value = undefined; |
// value 可选 new Date、时间戳、"2016-08-05 14:22:09" 时间格式 | |
// fmt 可选 以下格式(以及位置调换) | |
// yyyy-MM-dd hh:mm:ss | |
// yyyy-MM-dd hh:mm:ss.S | |
// yyyy/MM/dd hh:mm:ss | |
// yyyy年MM月dd日 hh时mm分ss秒 | |
// yyyyMMddhhmmss | |
function formatDate (value, fmt) { | |
// let v = value.replace(/-/g, "/").substring(0, 19); | |
let date = new Date(value) |
(function() { | |
const NotificationInstance = Notification || window.Notification; | |
if (!!NotificationInstance) { | |
const permissionNow = NotificationInstance.permission; | |
// 'default' 用户还未被询问是否授权,所以通知不会被显示 | |
// 'granted' 表示之前已经询问过用户,并且用户已经授予了显示通知的权限 | |
// 'denied' 用户已经明确的拒绝了显示通知的权限 | |
if (permissionNow === 'granted') { | |
// 允许通知 | |
CreatTask(); |
I hereby claim:
To claim this, I am signing this object: