0

I can't get this immutablejs map to error:

const alertModal: Map<AlertModalState> = Map(
  {
    'isAlertModalOpen': false,
    'alertModalTitle': '',
    'alertModalMessage': '',
    'height': 0,
    'hasYesNo': false
  }
)

type AlertModalState =  {
  isAlertModalOpen: boolean,
  alertModalTitle: string,
  alertModalMessage: string,
  height: number,
  hasYesNo: boolean
}

When I change the properties to have different names, they still don't produce a flow error. Is this code valid or should it produce an error?

BeniaminoBaggins
  • 11,202
  • 41
  • 152
  • 287

1 Answers1

0

This might help: How to describe Immutable.js Map shape with Flow

Immutable does have a type for "Maps" with shapes

pledez
  • 339
  • 1
  • 4
  • 19