Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sumup/collector

Package Overview
Dependencies
Maintainers
19
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sumup/collector - npm Package Compare versions

Comparing version 1.0.0-alpha.2 to 1.0.0-alpha.3

build/hooks/useSubmitTrigger/index.d.ts

2

package.json
{
"name": "@sumup/collector",
"sideEffects": false,
"version": "1.0.0-alpha.2",
"version": "1.0.0-alpha.3",
"main": "build/index.js",

@@ -6,0 +6,0 @@ "module": "build/index.es.js",

@@ -24,2 +24,3 @@ <div align="center">

- [useClickTrigger](#useclicktrigger)
- [useSubmitTrigger](#usesubmittrigger)
- [usePageViewTrigger](#usepageviewtrigger)

@@ -267,2 +268,37 @@ - [Code of Conduct (CoC)](#code-of-conduct-coc)

### useSubmitTrigger
`useSubmitTrigger` provides you a dispatch function for any kind of form submission event.
The dispatch function accepts the following interface:
```jsx
interface Options {
component?: string;
label?: string;
customParameters?: {
[key: string]: any
};
event: 'submit'; // Added internally by the hook
timestamp: number; // Added internally when the dispatch function is called
}
```
```jsx
import React from 'react';
import { useSubmitTrigger } from '@sumup/collector';
function Form({ children }) {
const dispatch = useSubmitTrigger();
const submitHandler = (e) => {
e.preventDefault();
dispatch({ component: 'form' });
};
return <form onSubmit={handler}>{children}</form>;
}
```
### usePageViewTrigger

@@ -269,0 +305,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc