@reduxjs/toolkit#PrepareAction TypeScript Examples

The following examples show how to use @reduxjs/toolkit#PrepareAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareSetMarkerCompleted: PrepareAction<MarkerCompletedActionPayload> = (
  key: MSFMarkerKey
) => {
  return { payload: { key, timestamp: getUnixTimestamp() } };
}
Example #2
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareSetMarkersCompleted: PrepareAction<MarkersCompletedActionPayload> = (
  keys: MSFMarkerKey[]
) => {
  return { payload: { keys, timestamp: getUnixTimestamp() } };
}
Example #3
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareReplaceMarker: PrepareAction<MarkerReplaceActionPayload> = (
  existingId: MSFMarkerID,
  newMarker: EditorMarker
) => {
  return { payload: { existingId, newMarker } };
}
Example #4
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareEditMarker: PrepareAction<MarkerEditActionPayload> = (
  existingId: MSFMarkerID,
  markerProperty: string,
  propertyValue
) => {
  return { payload: { existingId, markerProperty, propertyValue } };
}
Example #5
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareReplaceRoute: PrepareAction<RouteReplaceActionPayload> = (existingId, newRoute) => {
  return { payload: { existingId, newRoute } };
}
Example #6
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareEditRoute: PrepareAction<RouteEditActionPayload> = (
  existingId: MSFRouteID,
  routeProperty: string,
  propertyValue
) => {
  return { payload: { existingId, routeProperty, propertyValue } };
}
Example #7
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareSetMapPosition: PrepareAction<MapPosition> = (
  latlng: MapPosition['latlng'],
  zoom: MapPosition['zoom']
) => {
  return { payload: { latlng, zoom } };
}
Example #8
Source File: Actions.ts    From Teyvat.moe with GNU General Public License v3.0 5 votes vote down vote up
prepareSetLoading: PrepareAction<SetLoadingActionPayload> = (
  loadingKey: keyof LoadingState,
  newValue: LoadingEnum
) => {
  return { payload: { loadingKey, newValue } };
}