Tag:chain

  • Promise encapsulation of indexeddb transaction function

    Time:2021-7-9

    preface This paper introduces a by-product of writing indexeddb encapsulation Library — how to make indexeddb support chain call and transaction at the same time.Project address:https://github.com/woodensail/indexedDB 2015 / 11 / 12 note: there is something wrong with the idea of this article. Just have a look and understand it. Don’t do it like this. A […]

  • Promise encapsulation of indexeddb transaction function (2) — using generator to complete synchronization transformation

    Time:2021-7-8

    preface Originally, this series should not be updated so quickly, but I found a huge loophole in my thinking after I finished the previous one last night. As a result, I spent a lot of time in the previous article implementing a complex transaction class – there is a much simpler way to do it.First […]

  • Q. Comparison of several methods of creating promise object in JS

    Time:2021-7-5

    The furthest distance in the world is not the distance between life and death, but the document is right in front of you, and you still don’t know how to use this library. My IQ is not high, I have been abused by q.js for several days. Check thekriskowal/qThe following methods can transform the function […]

  • Go carbon version 1.3.4 is released, adding the century() method to get the century and fix known bugs

    Time:2021-7-4

    Carbon is a lightweight, semantic and developer friendly golang time processing library, which supports chain call, lunar calendar, Gorm, xorm and other mainstream orm If you think it’s good, please give it to a star github:github.com/golang-module/carbon gitee:gitee.com/go-package/carbon Update log Fix bug # 42 Where formart() method fails in some cases Optimize the lunar algorithm and […]

  • Restrictive data structure stack

    Time:2021-7-2

    1. Definition of stack 1.1 definition Stack is a linear table that only inserts and deletes at the end of the table.Top of stackThe end that allows insertion and deletion is called the top of the stack.Stack bottom: the other end corresponding to the top of the stack is called the bottom of the stack.Empty […]

  • Implementation of simple ES6 promise function (1)

    Time:2021-7-1

    Promise objects are used for deferred and asynchronous calculations. A promise object represents an operation that has not yet been completed but is expected to be completed in the future. Let’s start with an example a to get familiar with the grammar var p = new Promise(function(resolve, reject){ console.log(‘1’); //Run the subsequent callback list, for […]

  • JavaScript promise says goodbye to asynchronous random nesting

    Time:2021-6-16

    What is promise? Before we talk about promise, we have to say that JavaScript has nested callback functions In JavaScript language, whether it’s writing all kinds of event callbacks, AJAX callbacks, or business logic on node.js, the problem we have to face is all kinds of callback functions. Callback functionLess is good, once more and […]

  • Simple method and chain operation of jQuery based on JS

    Time:2021-6-10

    I use this article to explain how to use js to implement a simple method of encapsulating jQuery. In this paper, JS implements several methods of jQuery, and I divide it into eight small goals Implement the $(“. Box1”). Click() method Implement the $(“div”). Click() method Consider three cases of parameters in $() Implementation of […]

  • Realization of promise source code

    Time:2021-5-11

    Promise 1、 Simple use of promise new Promise((resolve, reject) => { resolve(“ok”) }).then(data => { console.log(data) //OK }, error => { console.log(error) }) //Simplify let promise = new Promise(executor) promise.then(onFulfilled, onRejected) It should be noted that executorIs a callback function that will be executed immediately with two parameters,resolveand reject IfexecutorCalled inresolve(value)So thisvalueWill be passed on […]

  • Merge sort and cardinal sort

    Time:2021-5-9

    Merge sort example Recursive sorting by iteration performance analysis Cardinal sort Multi keyword sorting Chain radix sort Comparison of various sorting methods

  • The realization of promise and the common test point of interview

    Time:2021-5-2

    Promise 1. Promise is a class in which an executor is required to be passed in. By default, promise will be passed inImmediately2. Promise has three states,pending , resolved , rejected, can only change from waiting state to other two states3. Promise official website specification:https://promisesaplus.com/4. Promise supports chain call, and its internal principle isPublish subscribe […]

  • The realization of promise and the common test point of interview

    Time:2021-5-1

    Promise 1. Promise is a class in which an executor is required to be passed in. By default, promise will be passed inImmediately2. Promise has three states,pending , resolved , rejected, can only change from waiting state to other two states3. Promise official website specification:https://promisesaplus.com/4. Promise supports chain call, and its internal principle isPublish subscribe […]