martyjs / marty

A Javascript library for state management in React applications
http://martyjs.org
MIT License
1.09k stars 76 forks source link

Store#fetch: Allow "falsy" IDs such as 0 #192

Closed denisw closed 9 years ago

denisw commented 9 years ago

Currently, when you pass an ID to Marty.Store#fetch which is not null or undefined, but "falsy" according to JavaScript's logic (such as 0 or the empty string), an exception with the message must specify an id is thrown. This pull request fixes that and makes sure to only throw an exception if either undefined or null is passed, but not for any other value.

jhollingworth commented 9 years ago

Hey, completely agree with the PR but would like to introduce this in the v0.9 branch if thats OK. I will update the code now