@vtex/order-manager
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -10,2 +10,7 @@ # Changelog | ||
## [0.4.0] - 2021-04-20 | ||
### Added | ||
- Argument to `useGetOrderForm` passing current `orderForm` and `setOrderForm` | ||
function. | ||
## [0.3.1] - 2021-04-13 | ||
@@ -12,0 +17,0 @@ |
/*! | ||
* @vtex/order-manager v0.3.1 | ||
* @vtex/order-manager v0.4.0 | ||
* (c) VTEX | ||
@@ -551,3 +551,2 @@ * Released under the MIT License. | ||
var _a; | ||
const { loading, data, error } = useGetOrderForm(); | ||
const shouldUseLocalOrderForm = typeof document !== 'undefined' && !navigator.onLine; | ||
@@ -557,2 +556,6 @@ const [orderForm, setOrderForm] = useReducer(reducer, (_a = (shouldUseLocalOrderForm | ||
: defaultOrderForm)) !== null && _a !== void 0 ? _a : defaultOrderForm); | ||
const { loading, data, error } = useGetOrderForm({ | ||
orderForm: orderForm, | ||
setOrderForm: setOrderForm, | ||
}); | ||
// use a different variable to store the loading state because if some | ||
@@ -559,0 +562,0 @@ // component uses the `loading` from the Apollo query they won't be perfectly |
/*! | ||
* @vtex/order-manager v0.3.1 | ||
* @vtex/order-manager v0.4.0 | ||
* (c) VTEX | ||
@@ -559,3 +559,2 @@ * Released under the MIT License. | ||
var _a; | ||
const { loading, data, error } = useGetOrderForm(); | ||
const shouldUseLocalOrderForm = typeof document !== 'undefined' && !navigator.onLine; | ||
@@ -565,2 +564,6 @@ const [orderForm, setOrderForm] = React.useReducer(reducer, (_a = (shouldUseLocalOrderForm | ||
: defaultOrderForm)) !== null && _a !== void 0 ? _a : defaultOrderForm); | ||
const { loading, data, error } = useGetOrderForm({ | ||
orderForm: orderForm, | ||
setOrderForm: setOrderForm, | ||
}); | ||
// use a different variable to store the loading state because if some | ||
@@ -567,0 +570,0 @@ // component uses the `loading` from the Apollo query they won't be perfectly |
{ | ||
"name": "@vtex/order-manager", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "cdn": "dist/index.umd.js", |
import type { FC } from 'react'; | ||
import type { OrderForm } from '../typings'; | ||
import type { OrderForm, OrderFormUpdate } from '../typings'; | ||
import type { createUseMessages } from './createUseMessages'; | ||
interface GetOrderFormHookArgs<O extends OrderForm> { | ||
orderForm: O; | ||
setOrderForm: (update: OrderFormUpdate<O>) => void; | ||
} | ||
export interface CreateOrderFormProviderParams<O extends OrderForm> { | ||
useOrderFormMessages: ReturnType<typeof createUseMessages>; | ||
useGetOrderForm: () => { | ||
useGetOrderForm: (args: GetOrderFormHookArgs<O>) => { | ||
data?: { | ||
@@ -18,2 +22,3 @@ orderForm: O; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=createOrderForm.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
198461
2565
0