Page MenuHomePhabricator

[lib][native][web] Extract chatMessageItemKey
ClosedPublic

Authored by ashoat on Wed, Oct 9, 8:29 PM.
Tags
None
Referenced Files
F3100492: D13682.id45041.diff
Wed, Oct 30, 3:04 AM
Unknown Object (File)
Wed, Oct 23, 7:25 AM
Unknown Object (File)
Sat, Oct 19, 5:15 AM
Unknown Object (File)
Fri, Oct 18, 10:58 PM
Unknown Object (File)
Fri, Oct 18, 5:35 AM
Unknown Object (File)
Thu, Oct 17, 10:57 AM
Unknown Object (File)
Wed, Oct 16, 9:30 AM
Unknown Object (File)
Tue, Oct 15, 10:33 PM
Subscribers
None

Details

Summary

This will make it easier to change its behavior in a later diff.

Depends on D13681

Test Plan

Flow

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested review of this revision.Wed, Oct 9, 9:43 PM
tomek added inline comments.
lib/shared/chat-message-item-utils.js
19–27 ↗(On Diff #45041)

Do we need to specify messageInfos here?

This revision is now accepted and ready to land.Fri, Oct 11, 6:06 AM
lib/shared/chat-message-item-utils.js
19–27 ↗(On Diff #45041)

Yes, it's necessary. Without explicitly listing messageInfos here, Flow deduces that the ... can contain messageInfos. As a result, Flow isn't able to narrow the type when we do a check like this:

if (item.messageInfos) {
  ...
}