martyjs / marty

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

No warning if hook id is missing #271

Closed grmlin closed 9 years ago

grmlin commented 9 years ago

Hi, I tried to add multiple hooks for my http state source and only the last one would be used. That's because hooks[hook.id] = hook; is used to store the hook, and omitting an id will of course do something like hooks[undefined] for all my hooks, overwriting the last one.

I think it should be documented in the http state source documentation and/or throw an error/warning.