Skip to content

VanDalkvist/lazy-sequence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lazy-sequence

JS function which executes functions passed by arguments in sequence somewhen you want it.

Examples

const fn = sequence(func1)(func2)(func3);
fn();

// will call all three functions in sequence


const fn = sequence(func1, func2, func3);
fn();

// the same as first


const fn = sequence(func1)(func2);
fn();

// will call two functions in sequence


const fn = sequence(func1)(func2)(func3);
fn({ title: "Hello world!" });

// will call all three functions in sequence with arguments. All functions will recieve the same argument - { title: "Hello world!" } in this case.


const fn = sequence(func1)(func2)(func3);
fn({ title: "Hello world!" }, func4);

// you can pass functions at the end only with non-functions arguments to understand it as a final execution.


About

JS function which executes functions passed by arguments in sequence somewhen you want it.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published