Hyperapp: Array as state is cast to Object

Created on 11 Jul 2017  路  3Comments  路  Source: jorgebucaran/hyperapp

This example does not work as expected: https://codepen.io/zaceno/pen/RgqOzL

It fails becasue the state is initialized as state: ['X', 'Y'], but then internally transformed into: {'0':'X, '1': 'Y'} (which does not have join, map or other array methods)

I believe this is a bug. Or it should be documented.

Docs

Most helpful comment

@zaceno Yes, you are right. Currently the only supported state types are object, string and number. We should write a proper essay on the state property and include this detail here.

All 3 comments

@zaceno Yes, you are right. Currently the only supported state types are object, string and number. We should write a proper essay on the state property and include this detail here.

Whoops! 馃槈

@zaceno Added it to #244.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dwknippers picture dwknippers  路  3Comments

jorgebucaran picture jorgebucaran  路  4Comments

jbrodriguez picture jbrodriguez  路  4Comments

dmitrykurmanov picture dmitrykurmanov  路  3Comments

ghost picture ghost  路  3Comments