Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Conversation

@semoal
Copy link
Member

@semoal semoal commented Aug 11, 2021

Finally found some time to work on this cool feature.

This introduces a little breaking change (which is not, because under the hood adapts the configuration to match the newest one if users are using the old one)

Basically now @rematch/loading plugin accepts a type property (By default is type: boolean)

This property accepts: 'number', 'boolean', 'full'

{ type: "full" }

Basically returns { success: false, loading: true, error: false }, if the effect promise returns an error the error response is added to error.

Works fine with Typescript as far as I could check.

Pending

  • Decide if 'detailed' is a good name
  • Documentation
  • More testing
  • Reduce bundle size a bit (there're some optimisations)

Will resolve #877

@semoal semoal requested a review from tianzhich August 11, 2021 16:21
@github-actions
Copy link

github-actions bot commented Aug 11, 2021

size-limit report 📦

Path Size
./packages/core/dist/core.umd.production.min.js 1.42 KB (0%)
./packages/immer/dist/immer.umd.production.min.js 143 B (0%)
./packages/loading/dist/loading.umd.production.min.js 706 B (+18.26% 🔺)
./packages/persist/dist/persist.umd.production.min.js 172 B (0%)
./packages/select/dist/select.umd.production.min.js 456 B (0%)
./packages/updated/dist/updated.umd.production.min.js 407 B (0%)
./packages/typed-state/dist/typed-state.umd.production.min.js 258 B (0%)

@semoal semoal force-pushed the semoal/feat-detailed-success-loading-error-plugin branch from b10cc1b to c713099 Compare August 11, 2021 17:26
@tianzhich
Copy link
Collaborator

How about 'detail' or 'details'?

@tianzhich
Copy link
Collaborator

plz check my commits and comments @semoal.

@semoal semoal mentioned this pull request Aug 12, 2021
15 tasks
@semoal semoal changed the title feat: loading plugin returns success/error/loading feat: @rematch/loading with type: 'full' returns success/error/loading Aug 12, 2021
@semoal semoal merged commit 6992fc5 into main Aug 12, 2021
@semoal semoal deleted the semoal/feat-detailed-success-loading-error-plugin branch August 12, 2021 07:21
semoal added a commit that referenced this pull request Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion: Error/success handling plugin

3 participants