Growing features

What we've done so far is basically useless. But, from now on, we will start to add features and make it capable of fitting in practical needs, including the capability of synchronizing multiple data items with multiple clients, and merging conflicts.

Synchronizing multiple items

Ideally, the data we need to synchronize will have a lot of items contained. Directly changing the type of data to an array would work if there were only very limited number of these items.

Simply replacing data type with an array

Now let's change the type of the data property of DataStore and DataSyncingInfo interfaces to string[]. With the help of TypeScript, you will get errors for unmatched types this change would cause. Fix them by annotating the correct ...

Get TypeScript Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.