Skip to content

what is "chain" for? #1

@dberardo-com

Description

@dberardo-com

here i tried to tyepscript the whole:

const cond = <T = any>(chain: T) => ({
          if(condition: boolean, thanF: (obj?: T) => T, elseF?: (obj?: T) => T) {
            return cond(condition ? thanF(chain) : elseF ? elseF(chain) : chain);
          },
          chain(f: any) {
            return cond(f(chain));
          },
          end() {
            return chain;
          }
      })

what is the "chain" function for ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions