choojs / choo

:steam_locomotive::train: - sturdy 4kb frontend framework
https://choo.io/
MIT License
6.78k stars 595 forks source link

Rendering cached components should be done by id only #670

Closed YerkoPalma closed 6 years ago

YerkoPalma commented 6 years ago

Expected behavior

After rendering a component like

state.cache(PostPreview, 'post-id').render()

next uses of the same component should be done from cache like

state.cache('post-id').render()

Actual behavior

This call

state.cache('post-id').render()

throws an exception. Even this call

state.cache(null, 'post-id').render()

throws an exception. the only way to do this is by passing a noop to the cache method.