whydoidoit / resolver

Resolves a value that might be a function to the final value

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

Resolve resolves a final value, it may be passed a function or a value and calls the function to produce a value in that mode.

Installation

npm install --save whydoidoit-resolver

Usage

import resolve from 'whydoidoit-resolver'

...

this.y = 10;
console.log(resolve(this.y)); //Logs 10
this.y = function() {
    return 20;
}
console.log(resolve(this.y)); //Logs 20


About

Resolves a value that might be a function to the final value


Languages

Language:JavaScript 100.0%