1.2.10 • Published 8 years ago

asyncworkflow v1.2.10

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

asyncworkflow

Simple library that allows you to run async promise based code as if you were writing synchronous code.

How to use

If you are using es6 then simpoy import the library and call it.

import asyncLib from 'asyncworkflow'

asyncLib.runAsyncWorkflow( ## YOUR GENERATOR FUNCTION ## )();

Please note that your comsuming app will require babel-polyfill.

Typical Scenarios

You can use this library when youu don't want to get caught up in the .then chain hell that can happen within promises.

Example

Write your generator that has aync (promise based code) and sync code lines:

 	let myGenerator = function*() {
				let result1 = yield axios.get('some http call');
				let result2 = doSynchronousCall(result1);
				let result3 = yield callAnotherAsyncPromiseBasedThing(result2);
				return result3;
			};

  asyncLib.runAsyncWorkflow(myGenerator)();

Notes

You can run my library directly within your ES6 project by lifting the file 'index_src.js' from within the 'src' folder.

1.2.10

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago