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(core)!: merge MaskitoElementPredicate & MaskitoElementPredicateAsync into single type #757

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

nsbarsukov
Copy link
Member

@nsbarsukov nsbarsukov commented Dec 12, 2023

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Refactoring
  • Build or CI related changes
  • Tests related changes
  • Documentation content changes

What is the current behaviour?

@maskito/core source code:

export type MaskitoElementPredicate = (
    element: HTMLElement,
) => HTMLInputElement | HTMLTextAreaElement;

export type MaskitoElementPredicateAsync = (
    element: HTMLElement,
) => Promise<HTMLInputElement | HTMLTextAreaElement>;

Your code:

import {
    MaskitoElementPredicate,
    MaskitoElementPredicateAsync,
} from '@maskito/core';

const syncPredicate: MaskitoElementPredicate = element =>
    element.querySelectorAll('input')[1]!;

const asyncPredicate: MaskitoElementPredicateAsync = async element =>
    Promise.resolve(element.querySelectorAll('input')[1]!);

What is the new behaviour?

@maskito/core source code:

export type MaskitoElementPredicate = (
    element: HTMLElement,
) =>
    | HTMLInputElement
    | HTMLTextAreaElement
    | Promise<HTMLInputElement | HTMLTextAreaElement>;

Your code:

import {MaskitoElementPredicate} from '@maskito/core';

const syncPredicate: MaskitoElementPredicate = element =>
    element.querySelectorAll('input')[1]!;

const asyncPredicate: MaskitoElementPredicate = async element =>
    Promise.resolve(element.querySelectorAll('input')[1]!);

Closes #607

Copy link
Contributor

Visit the preview URL for this PR (updated for commit d55c85c):

https://maskito--pr757-element-predicate-x9i2wujh.web.app

(expires Wed, 13 Dec 2023 13:01:04 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 61e4dea776cbea516b68c67840913d2edd88bb90

@nsbarsukov nsbarsukov marked this pull request as ready for review December 12, 2023 13:09
@github-actions github-actions bot added the ready to merge ready label Dec 12, 2023
@nsbarsukov nsbarsukov merged commit 640a631 into main Dec 12, 2023
25 checks passed
@nsbarsukov nsbarsukov deleted the element-predicate branch December 12, 2023 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 - Merge MaskitoElementPredicateAsync & MaskitoElementPredicate into the single type
2 participants