stampit-org / react-stampit

A specialized stampit factory for React
131 stars 1 forks source link

Add initializers prop to description object #33

Closed troutowicz closed 9 years ago

troutowicz commented 9 years ago

Issue #31

@ericelliott

Why not add .compose() and initializers seeing as how we need to get moving toward the open Stamp specification anyway?

.compose is already present. We do need to to make a compose util though.

troutowicz commented 9 years ago

Thoughts on limiting react-stampit's initializers property to one function (rename to init in this case) instead of an array of functions? Would there ever be a time when an array of initializers would make sense in React?

joshdmiller commented 9 years ago

I like this. I can't think of any time that we would end up with multiple initializers on a React component without composing them, but since one could provide a function instead of an array and it would still work, I'm not sure it should be restricted.

With other names matching (e.g. refs and methods), should initializers be init to match?

Clarification: I meant I think initializers should be init even if it is an array, since in stampit-land init can take an array of functions too.

troutowicz commented 9 years ago

but since one could provide a function instead of an array and it would still work, I'm not sure it should be restricted.

Good point.

With other names matching (e.g. refs and methods), should initializers be init to match?

The reason I used initializers was to conform with the current stamp specification. I personally like init more, but \o/.

ericelliott commented 9 years ago

initializers in the stamp spec is just the name of the fixed stamp descriptor property. You're free to do whatever you want with helper functions/methods.

troutowicz commented 9 years ago

Ah, right... I misread the spec.

ericelliott commented 9 years ago

=)