How to use the @reduxjs/toolkit.isFulfilled function in @reduxjs/toolkit

To help you get started, we’ve selected a few @reduxjs/toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pipe-cd / pipe / pkg / app / web / src / modules / applications.ts View on Github external
state.disabling[action.meta.arg.applicationId] = false;
        applicationsAdapter.removeOne(state, action.meta.arg.applicationId);
      })
      .addCase(disableApplication.rejected, (state, action) => {
        state.disabling[action.meta.arg.applicationId] = false;
      })
      .addCase(updateDescription.fulfilled, (state, action) => {
        applicationsAdapter.updateOne(state, {
          id: action.meta.arg.applicationId,
          changes: {
            description: action.meta.arg.description,
          },
        });
      })
      .addMatcher(
        isFulfilled(fetchApplications, fetchApplicationsByEnv),
        (state, action) => {
          applicationsAdapter.removeAll(state);
          applicationsAdapter.upsertMany(
            state,
            action.payload.filter((app) => app.deleted === false)
          );
          state.loading = false;
        }
      );
  },
});