corebasic 1.0.147 → 1.0.148
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libs/dip.js +13 -0
- package/package.json +1 -1
package/libs/dip.js
CHANGED
|
@@ -55,6 +55,19 @@ export const IdempotentDip = () => {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
export const idip = async (message, callback, cleanup) => {
|
|
59
|
+
let IDip = await IdempotentDip().new(message.meta, message.txn)
|
|
60
|
+
if (!IDip) {
|
|
61
|
+
IDip = IdempotentDip().new(message.meta, message.txn, {blank: true})
|
|
62
|
+
await cleanup(IDip)
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
await callback(IDip)
|
|
66
|
+
await IDip.finish()
|
|
67
|
+
await cleanup(IDip)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
58
71
|
export const insertKeys = message => {
|
|
59
72
|
return {"created": message.date, "updated": message.date, "createdBy": message.user, "updatedBy": message.user}
|
|
60
73
|
}
|