mozilla / reflex

Functional reactive UI library
MIT License
367 stars 20 forks source link

Effects.batch should complain if it doesn't get called with an array #43

Closed gordonbrander closed 7 years ago

gordonbrander commented 8 years ago

Currently calling Effects.batch(Effect, Effect, Effect) will fail silently. We should make this accidental call an exception or otherwise notify the developer.

Gozala commented 8 years ago

One thing to keep in mind is that flow type checker will catch that error. That being said if user does not use flow it's not going to help much. I need to find a way to report such errors without introducing perf tax to users with a type checker. The problem isn't free if (!Array.isArray(fx)) { throw ... }.

I could probably have reflex.noflow.js builds that would have those extra checks.

gordonbrander commented 8 years ago

@Gozala good point about the type checker. I'm not sure if its worth keeping this open.

Gozala commented 7 years ago

Closed as suggested in last comment.