metarhia / do Goto Github PK
View Code? Open in Web Editor NEWSimplest way to manage asynchronicity
Home Page: https://metarhia.com
License: MIT License
Simplest way to manage asynchronicity
Home Page: https://metarhia.com
License: MIT License
With transpiring and minification
collector.count
is initial data piece amount
See metarhia/metasync#286 but do
is light version of metasync
we need to support just chain/do and collector.
collector.collected
- current collected data piece amount
collector.expected
- initial expected data piece amount
const chain = require('do');
const c1 = chain
.do(readConfig, 'myConfig')
.do(selectFromDb, 'select * from cities')
.do(getHttpPage, 'http://kpi.ua')
.do(readFile, 'README.md');
c1((err, data) => {});
Refs: metarhia/metasync#278
const chain = require('do');
const fs = require('fs');
const dc = chain.do(4); // collector
dc.pick('user', { name: 'Marcus Aurelius' });
fs.readFile('HISTORY.md',
(err, data) => dc.collect('history', err, data)
);
dc.take('readme', fs.readFile, 'README.md');
setTimeout(() => dc.pick('timer', { date: new Date() }), 1000);
Implementation @machendos
Review @lundibundi
Refs: https://github.com/metarhia/metasync
See: lib/do.js
See example here: https://github.com/metarhia/metasync
// Short syntax
fs.readFile('README.md', dc('readme'));
// is equivalent for
fs.readFile('README.md', dc.callback('readme'));
// and
fs.readFile('README.md',(err, data) => dc.collect('readme', err, data));
See: #14
Refactor module structure to have multiple implementations
This will return callback from dc functor binded to specified key dc.callback('key')
with error-first
contract.
Remove dox and qunit after #3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.