Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new fetch state machine #202

Merged
merged 14 commits into from
Sep 15, 2024
Merged

feat: new fetch state machine #202

merged 14 commits into from
Sep 15, 2024

Conversation

alimd
Copy link
Member

@alimd alimd commented Sep 15, 2024

  • feat: Add @alwatr/fetch-state-machine package
  • refactor: Remove unused dependencies from @alwatr/fsm package
  • refactor: Update all package URLs to point to the flux repository
  • refactor: Update package dependencies and references
  • refactor: Rename fetch-state-machine.ts to base.ts and update imports
  • refactor: Rename fetch-state-machine.ts base class name
  • refactor: Make dispatch__ method private in AlwatrObservable class
  • refactor: Update @alwatr/polyfill-has-own dependency to version ^1.0.9 in fsm package.json
  • deps: update
  • refactor(fetch-state-machine): base class and imports
  • feat(fetch-state-machine): Add AlwatrJsonFetchStateMachineBase class
  • feat(fetch-state-machine): Add AlwatrJsonFetchStateMachine class
  • refactor(fetch-state-machine): Add JFSM classes
  • chore: Update .vscode/settings.json

Add new package @alwatr/fetch-state-machine with its main files, demo files, and package.json configuration.
Update the package dependencies and references in the @alwatr/context, @alwatr/fetch-state-machine, @alwatr/fsm, and @alwatr/signal packages. Add the @alwatr/observable package as a dependency and reference in the appropriate packages.
- Renamed fetch-state-machine.ts to base.ts in the fetch-state-machine package
- Updated imports in base.ts to use AlwatrFluxStateMachineBase instead of FiniteStateMachineBase
- Removed unused dependencies from @alwatr/fsm package
- Rename fetch-state-machine.ts to base.ts
- Update imports in fetch-state-machine.ts
- Make dispatch__ method private in AlwatrObservable class
- Update @alwatr/polyfill-has-own dependency to version ^1.0.9 in fsm package.json
- Rename fetchOptions__ to fetchOptions_ in AlwatrFetchStateMachineBase class
- Rename response_ to rawResponse_ in AlwatrFetchStateMachineBase class
- Update fetch_ method in AlwatrFetchStateMachineBase class
- Update requestAction__ method in AlwatrFetchStateMachineBase class
- Update resetToInitialState_ method in AlwatrFetchStateMachineBase class
This commit adds the AlwatrJsonFetchStateMachineBase class to the fetch-state-machine package. This class extends the AlwatrFetchStateMachineBase class and provides additional functionality for handling JSON responses in fetch requests. It includes methods for parsing the response text into a JSON object and handling errors related to invalid response text or JSON parsing.

The AlwatrJsonFetchStateMachineBase class also includes a jsonResponse_ property to store the parsed JSON response.

This commit also includes the necessary imports and type definitions for the new class.

Refactor the fetch-state-machine package to include the AlwatrJsonFetchStateMachineBase class and its dependencies.
@alimd alimd self-assigned this Sep 15, 2024
@alimd alimd requested a review from a team September 15, 2024 12:52
@alimd alimd added new-feature New features or options. refactor Updating the code with simpler, easier to understand or more efficient syntax or methods. breaking-change A change that changes the API or breaks backward compatibility for users. labels Sep 15, 2024
@alimd alimd merged commit 676aa0d into next Sep 15, 2024
1 of 2 checks passed
@alimd alimd deleted the feat/fetch-state-machine branch September 15, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that changes the API or breaks backward compatibility for users. new-feature New features or options. refactor Updating the code with simpler, easier to understand or more efficient syntax or methods.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant