Skip to content

mopeys/enum-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enum-hub

Install

$ npm install @mopeys/enum-hub

Usage

const eh = new EnumHub({
  fetchRemote: async (name) => {
    return await fetch(`/api/enum/${name}`);
  },
});

async function main() {
  await eh.getEnum("MEDICAL_TYPE"); // first time, from remote
  await eh.getEnum("MEDICAL_TYPE"); // from local
}

main();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published