How to use Generator to implement a chain dependent function?

how do I use generator to achieve the following functions?

    function f1(){
        return new Promise((resolve,reject) =>{
            setTimeout(() =>{
                resolve(1);
            },1000)
        })
    }
    
    function f2(value){
        return new Promise((resolve,reject) =>{
            setTimeout(() =>{
                resolve(value + 2);
            },1000)
        })
    }
    
    function f3(value){
        return new Promise((resolve,reject) =>{
            setTimeout((value) =>{
                resolve(value + 3);
            },1000)
        })
    }
    
    const foo = async () =>{
        let result_1 = await f1();
        let result_2 = await f2(result_1);
        let result_3 = await f3(result_2);
        return result_3;
    }
    
    foo();

Thank you for your reply!

Feb.27,2021

function f1(){
        return new Promise((resolve,reject) =>{
            setTimeout(() =>{
                resolve(1);
            },1000)
        })
    }

    function f2(value){
        return new Promise((resolve,reject) =>{
            setTimeout(() =>{
                resolve(value + 2);
            },1000)
        })
    }

    function f3(value){
        return new Promise((resolve,reject) =>{
            setTimeout(() =>{
                resolve(value + 3);
            },1000)
        })
    }

    function* test() {
        var result=yield f1();
        result=yield f2(result);
        yield f3(result);
    }
    function co(fun){
        var t=fun();
        var result=null;
        var _r;
        var p=new Promise(function(resole){
            _r=resole;
        });
        function next(data){
            var d=t.next(data);
            result=data;
            if(d.value){
                d.value.then(function(data){
                    next(data);
                })
            }else{
                _r(result);
            }
        }
        next();
        return p;
    }
    co(test).then(console.log);

isn't it co?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c57b-2bb04.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c57b-2bb04.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?