traitify-widgets 3.0.0-alpha.35 → 3.0.0-alpha.37
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/README.md +9 -5
- package/build/traitify.js +1 -1
- package/build/traitify.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,16 +117,20 @@ export default function Personality({id}) {
|
|
|
117
117
|
|
|
118
118
|
## Events
|
|
119
119
|
|
|
120
|
-
Most components trigger an initialized and updated event
|
|
120
|
+
- Most components trigger an initialized and updated event
|
|
121
|
+
- Event handlers must be set before the render command or they will not be called
|
|
122
|
+
- Some events may fire multiple times, once for each target specified (such as the Survey and Results)
|
|
123
|
+
|
|
124
|
+
The widgets are capable of showing multiple kinds of surveys to users in order to satisfy benchmark requirements. To handle the event when all surveys have been finished you should use this event:
|
|
121
125
|
|
|
122
|
-
The widgets are capable of showing multiple kinds of surveys to users in order to satisfy benchmark requirements, to handle the event when all surveys have been finished you should use this event:
|
|
123
126
|
```
|
|
124
|
-
Traitify.listener.on("Surveys.
|
|
125
|
-
console.log("Surveys.
|
|
127
|
+
Traitify.listener.on("Surveys.finished", (surveys) => {
|
|
128
|
+
console.log("Surveys.finished", surveys);
|
|
126
129
|
});
|
|
127
130
|
```
|
|
128
131
|
|
|
129
|
-
To handle the event when each survey has been finished, maybe to record total
|
|
132
|
+
To handle the event when each survey has been finished, maybe to record total progress in a backend system:
|
|
133
|
+
|
|
130
134
|
```
|
|
131
135
|
Traitify.listener.on("Survey.finished", ({response}) => {
|
|
132
136
|
console.log("Survey.finished", response);
|