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

Implement delegated properties on BotContext #230

Merged
merged 2 commits into from Apr 13, 2022

Conversation

nikvoloshin
Copy link
Contributor

This PR adds handy functions clientProperty, sessionProperty and tempProperty for easy defining extension properties on BotContext.
Also allows defining extensions on any class by providing BotContext selector:

val DefaultActionContext.prop by clientProperty { "abc" } withContext { context }

*/
fun <V> tempProperty(
key: String? = null,
saveDefault: Boolean = false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temp property cannot be saved or removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you, please, clarify what do you mean exactly?
I think it can be both saved and removed during single request execution.
It cannot be "persisted", but I don't use this word.

Copy link
Contributor

@morfeusys morfeusys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikvoloshin please extend JAICF documentation with this feature description

@nikvoloshin nikvoloshin merged commit 5ebff2e into master Apr 13, 2022
@nikvoloshin nikvoloshin deleted the feature/botcontext-delegates branch April 13, 2022 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants