@ask-utils/labo
TypeScript icon, indicating that this package has built-in type declarations

3.11.0 • Public • Published

ASK Utils Labo

npm version License: MIT Maintainability Test Coverage Build Status logo

https://ask-utils.dev

Experimental modules of ask-utils

Getting started

$ npm i -S @ask-utils/labo

Features

PersistentAttributesManager

Wrapper class of PersistentAttributesManager to handle the props more easily.

Usage

const persistentAttributesManager = PersistanteAttributesManager.getInstance(handlerInput.attributesManager)
await persistentAttributesManager.updatePersistentAttributes({
    name: 'John'
})
await persistentAttributesManager.save()

Auto merge the props

await persistentAttributesManager.updatePersistentAttributes({
    name: 'John',
    count: 1,
})
await persistentAttributesManager.save()


await persistentAttributesManager.updatePersistentAttributes({
    message: 'hello',
    count: 2,
})
await persistentAttributesManager.save()

console.log(await persistentAttributesManager.getPersistentAttributes())

{
    name: 'John',
    count: 2,
    message: 'hello',
}

Detect should call AWS APIs

If no property has been updated, it will not call AWS API.

const persistentAttributesManager = PersistanteAttributesManager.getInstance(handlerInput.attributesManager)

// NOTHING TO DO
await persistentAttributesManager.save()

await persistentAttributesManager.updatePersistentAttributes({
    name: 'John'
})
// CALL attributeManager.savePersistentAttributes to save the update
await persistentAttributesManager.save()

// NOTHING TO DO
await persistentAttributesManager.save()

Readme

Keywords

none

Package Sidebar

Install

npm i @ask-utils/labo

Weekly Downloads

0

Version

3.11.0

License

MIT

Unpacked Size

19.8 kB

Total Files

26

Last publish

Collaborators

  • hideokamoto