SkillAgentSearch skills...

Fan.js

A simple and easy-to-understand implementation of Promise/A+ spec for learning.

Install / Use

/learn @dukeluo/Fan.js
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<a href="https://promisesaplus.com/"> <img src="https://promisesaplus.com/assets/logo-small.png" alt="Promises/A+ logo" title="Promises/A+ 1.0 compliant" align="right"> </a>

fan.js

fan.js is a implementation of the Promise/A+ spec written in ES5. It uses a simple and easy-to-understand style that closely matches every line of the spec. fan.js is a good example to reference when creating your own Promise and to help you learn the Promise/A+ spec.

Live Demo

Tasks for Creating Your Own Implementation of Promises/A+ Spec

  • Read the specification with use cases. Do it again if you have no idea how to begin.
  • Define the Promise class or constructor.
  • Make the Promises/A+ Compliance Test Suite works well with your code.
  • Define the then() method.
  • Implement chaining.
  • Handle errors.

Running the Test Suite

fan.js has passed all the tests in the Promises/A+ Compliance Test Suite.

To run all the tests, use the following command:

npm run test

The Promises/A+ Compliance Test Suite organizes tests by spec requirements. If you want to run the tests for a specific requirement, use a command like:

npm run test -- grep 2.1.2

Useful Resources

View on GitHub
GitHub Stars5
CategoryProduct
Updated2y ago
Forks0

Languages

JavaScript

Security Score

75/100

Audited on Oct 17, 2023

No findings