Skip to content

SudoDotDog/Sudoo-Symbol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoo-Symbol

Continuous Integration codecov npm version downloads

Symbol Magic

Install

yarn add @sudoo/symbol
# Or
npm install @sudoo/symbol --save

Example

Symbol should be used as return values (and more!) to express more information from functions.

import { SEmptyReturn, EmptyReturnSymbol } from "@sudoo/symbol";

export const yourFunction = (arg: any): SEmptyReturn | AwesomeObject | null => {

    if (arg === null) {
        return null;
    }

    if (arg.hasNoData) {
        return EmptyReturnSymbol;
    }

    return arg.awesomeObject;
};

Note

Do not use @sudoo/symbol as required dependencies unless the project is not a package. Due to duplicated copy of package would cause type reference issue.

About

🔥 Symbol Magic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •