f / delorean

An Agnostic, Complete Flux Architecture Framework
749 stars 40 forks source link

JsFiddle example does not work: Object is not a function. #79

Closed abacaj closed 9 years ago

abacaj commented 9 years ago

JsFiddle example presented on the website does not work, see below:

darcyadams commented 9 years ago

fixed.

nigelwtf commented 9 years ago

Hey @darcyadams, I'd like to indicate that this is occurring for me as well: Chrome 42.0.2311.152 and Windows 8.

Noticed it first in my local app, but happening on the JS Fiddle as well :/

darcyadams commented 9 years ago

The js fiddle in the current master docs should now work. The specific issue is that the stores are now singletons, so the return value from Flux.createStore is the store instance, no need for instantiation. This pattern is more 'fluxy'. If I missed a link in the docs to a bunk js fiddle, please point me to the doc with the bad link, and I will get it fixed. Thanks.

nigelwtf commented 9 years ago

Okay cool. I'm guessing this is a recent change?

I'm looking at the ReactJS example: http://jsfiddle.net/fkadev/a2ms7rcc/

Is there a way to coerce the Stores API to return a new instance anyway? I'm currently using a small interface to create and get store instances, as I'm building the stores for a block of components, and assuming that there can be multiple instances on a single page.

Edit: Sorry scrap this. Misinterpreted what you said. Cheers.

darcyadams commented 9 years ago

The 0.8.x release and earlier allows multiple instances of the same store, but we switched to the singleton pattern as the intent of flux is to only have a single store of each type. The idea being that any component can be wired up to any store from which it needs to draw data. The should never be a need for multiple instances of a store.