NestedTypes icon indicating copy to clipboard operation
NestedTypes copied to clipboard

Enum type

Open gaperton opened this issue 11 years ago • 5 comments

  • it must support iteration through its option
  • it must perform type casts on assignments.
  • it must support display names, symbolic shortcuts, and serialization ids.
  • syntax must be declarative and minimalistic.

Something like this:

var ChartTypes = Nested.Enum( 'one', 'two', 'three' );

var ChartTypes = Nested.Enum( { id : 'one', label : 'One' }, { id: 2, name: 'two', label: 'Two' }, 'three' );

ChartTypes.each( ... ) // underscore methods must be proxied

ChartTypes.one // elements should be available by name

Should behave as String. Could be implemented internally as Model.from.

gaperton avatar Nov 16 '14 13:11 gaperton

waiting eagerly.

kkilictepe avatar May 22 '15 23:05 kkilictepe

Will do it next after I finish my work in f/optimized-set branch. This is complete rewrite of the library, making model attributes assignments something like 10x faster than in vanilla backbone. Will finish it soon, next week.

gaperton avatar May 22 '15 23:05 gaperton

Thx a lot.

kkilictepe avatar May 22 '15 23:05 kkilictepe

+1

Bolik avatar Aug 10 '16 12:08 Bolik

Ok, I will add enum too soon. It should be really cool.

gaperton avatar Aug 10 '16 20:08 gaperton