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: 🎸 added option to handle prev/next button in the browser #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

akaNightmare
Copy link

@akaNightmare akaNightmare commented Jun 19, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

closes #13

@stackblitz
Copy link

stackblitz bot commented Jun 19, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal
Copy link
Member

Please add test

const { queryKey } = def;
const queryParamValue = queryParams.get(queryKey);

if (!queryParamValue) continue;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.
When using updateOn: 'submit', need to clear form controls to prev state

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed? can you please elaborate? I don't understand from your comment

@@ -50,8 +50,8 @@ export class QueryParamDef<QueryParams = any> {
return serializedValue === '[object Object]' ? JSON.stringify(controlValue) : serializedValue;
}

parse(queryParamValue: string) {
if (this.parser) {
parse(queryParamValue: string | null) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not pass null(undefined) values to custom parser function. Otherwise it causes breaking changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand your comment, why do you need this change?

@akaNightmare
Copy link
Author

@NetanelBasal done

@NetanelBasal
Copy link
Member

@shaharkazaz please check this

@akaNightmare
Copy link
Author

:)

@shaharkazaz
Copy link
Contributor

@akaNightmare didn't forget that, I'm on vacation 😀
I'll review once I get back

parse(queryParamValue: string) {
if (this.parser) {
parse(queryParamValue: string | null) {
if (this.parser && queryParamValue != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.parser && queryParamValue != null) {
if (this.parser && queryParamValue !== null) {

@@ -50,8 +50,8 @@ export class QueryParamDef<QueryParams = any> {
return serializedValue === '[object Object]' ? JSON.stringify(controlValue) : serializedValue;
}

parse(queryParamValue: string) {
if (this.parser) {
parse(queryParamValue: string | null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand your comment, why do you need this change?

const { queryKey } = def;
const queryParamValue = queryParams.get(queryKey);

if (!queryParamValue) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed? can you please elaborate? I don't understand from your comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request - Add option to handle back button in the browser
3 participants