Skip to content

Conversation

iamnotstone
Copy link

In some times the function can be a generator. So have to write the set function in this way:

set(key, value){
  if(typeof value.next === 'function'){                                       
    let result                                                                
     result = value.next()                                                     
     while(!result.done){                                                      
       result = value.next()                                                   
     }                                                                         
     return store[key] = result.value                                                 
  }                                                                           
  else                                                                        
     return store[key] = value
}

to enable this, I have to make some difference in source code. hope this is helpful!

@codecov-io
Copy link

codecov-io commented Jun 29, 2019

Codecov Report

Merging #75 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #75   +/-   ##
=======================================
  Coverage   97.29%   97.29%           
=======================================
  Files           1        1           
  Lines          37       37           
  Branches        8       10    +2     
=======================================
  Hits           36       36           
  Misses          1        1
Impacted Files Coverage Δ
src/index.js 97.29% <100%> (ø) ⬆️

@caiogondim
Copy link
Owner

Could you push some tests for it as well?

@iamnotstone
Copy link
Author

test code added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants