lowdefy/packages/docs/actions/Reset.yaml
2021-01-19 12:36:43 +02:00

60 lines
1.9 KiB
YAML

# Copyright 2020-2021 Lowdefy, Inc
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
_ref:
path: templates/general.yaml.njk
vars:
pageId: Reset
pageTitle: Reset
section: Actions
content:
- id: markdown
type: Markdown
style:
'.markdown-body':
fontSize: 14px
properties:
content: |
The `Reset` actions resets a context to the state it was in just after the `onInit` action was executed. This clears the user's inputs.
The `Reset` action does not take any parameters.
- id: warning
type: Alert
properties:
type: warning
message: Warning
description: The Reset action resets the state to the state before the onEnter action is executed, and the onEnter action is not executed after the reset happens. This might cause unexpected behavior if you used an onEnter action to initialize the state.
- id: markdown2
type: Markdown
style:
'.markdown-body':
fontSize: 14px
properties:
content: |
### Examples
A reset button:
```
- id: reset_button
type: Button
properties:
title: Reset
actions:
onClick:
- id: reset
type: Reset
```