martyjs / marty

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

Remove id from fetchHistory #354

Closed quazzie closed 8 years ago

quazzie commented 9 years ago

Is there a better way to remove an id from fetchHistory other than delete this.__fetchHistory['id'] ?

I have a store function getAll() that does a fetch for all items. I then have a couple of Containers with pending handlers and such. I then have an refresh action that the store handles where i do delete this.__fetchHistory['all'] so i can reuse all the containers pending handlers.

Would be nice with an 'official' way for this maybe.

Related i would be nice to have an 'official' way to remove something from failedFetches also. See #284 Now i have a refresh action that my store handles and does delete this.__failedFetches[id] to fetch again.

taion commented 9 years ago

Maybe we can add a refresh argument to Store#fetch that will bypass the locally stored value and always trigger a remote fetch (if one is not pending)?

idolizesc commented 9 years ago

@taion This would be great!