HomePhabricator
Diffusion Comm 9ce16932b467

[lib/native/web] introduce synced metadata reducer

Description

[lib/native/web] introduce synced metadata reducer

Summary:
Introduces the synced metadata reducer which handles replace, remove, and remove all ops.

Depends on D11421

Test Plan:
Ran the following code:

const onPressSave = React.useCallback(async () => {
  dispatch({
    type: addSyncedMetadataEntryActionType,
    payload: {
      name: 'Test_1_name',
      data: 'Test_1_data',
    },
  });

  dispatch({
    type: addSyncedMetadataEntryActionType,
    payload: {
      name: 'Test_2_name',
      data: 'Test_2_data',
    },
  });

  dispatch({
    type: addSyncedMetadataEntryActionType,
    payload: {
      name: 'Test_1_name',
      data: 'Test_1_update',
    },
  });

  dispatch({
    type: removeSyncedMetadataEntryActionType,
    payload: {
      name: 'Test_2_name',
    },
  });
}, [dispatch]);

Screenshot 2024-03-27 at 8.07.39 PM.png (778×848 px, 139 KB)

Reviewers: ginsu, atul, kamil

Reviewed By: atul, kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11422

Details

Provenance
willAuthored on Mar 22 2024, 6:17 AM
Reviewer
atul
Differential Revision
D11422: [lib/native/web] introduce synced metadata reducer
Parents
rCOMMebc836f84cf9: [lib] introduce sync metadata add and remove action types
Branches
Unknown
Tags
Unknown