File tree Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Expand file tree Collapse file tree 3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ const feedbackMachine = createMachine({
27
27
}
28
28
}, {
29
29
actions: {
30
- track : ({ action } ) => {
31
- track (action . params );
30
+ track : (_ , params ) => {
31
+ track (params );
32
32
// tracks { response: 'good' }
33
33
},
34
34
showConfetti : () => {
@@ -249,7 +249,7 @@ const feedbackMachine = createMachine(
249
249
{
250
250
// highlight-start
251
251
actions: {
252
- track : ({ context , event }) => {
252
+ track : ({ context , event }, params ) => {
253
253
// Action implementation
254
254
// ...
255
255
},
@@ -266,7 +266,7 @@ const feedbackActor = createActor(
266
266
// highlight-start
267
267
feedbackMachine .provide ({
268
268
actions: {
269
- track : ({ context , event }) => {
269
+ track : ({ context , event }, params ) => {
270
270
// Overridden action implementation
271
271
// ...
272
272
},
Original file line number Diff line number Diff line change @@ -266,8 +266,8 @@ const machine = createMachine({
266
266
const actor = createActor (
267
267
machine .provide ({
268
268
actions: {
269
- notify : ({ action } ) => {
270
- console .log (action . params .message ?? ' Default message' );
269
+ notify : (_ , params ) => {
270
+ console .log (params .message ?? ' Default message' );
271
271
},
272
272
activate : () => {
273
273
console .log (' Activating' );
@@ -337,8 +337,8 @@ const actor = createActor(
337
337
// highlight-start
338
338
guards: {
339
339
canBeToggled : ({ context }) => context .canActivate ,
340
- isAfterTime : ({ guard } ) => {
341
- const { time } = guard . params ;
340
+ isAfterTime : (_ , params ) => {
341
+ const { time } = params ;
342
342
const [hour, minute] = time .split (' :' );
343
343
const now = new Date ();
344
344
return now .getHours () > hour && now .getMinutes () > minute ;
Original file line number Diff line number Diff line change @@ -143,10 +143,10 @@ const feedbackMachine = createMachine(
143
143
{
144
144
// highlight-start
145
145
guards: {
146
- isValid : ({ context , guard } ) => {
146
+ isValid : ({ context }, params ) => {
147
147
return (
148
148
context .feedback .length > 0 &&
149
- context .feedback .length <= guard .maxLength
149
+ context .feedback .length <= params .maxLength
150
150
);
151
151
},
152
152
},
@@ -162,10 +162,10 @@ const feedbackActor = createActor(
162
162
// highlight-start
163
163
feedbackMachine .provide ({
164
164
guards: {
165
- isValid : ({ context , guard } ) => {
165
+ isValid : ({ context }, params ) => {
166
166
return (
167
167
context .feedback .length > 0 &&
168
- context .feedback .length <= guard .maxLength &&
168
+ context .feedback .length <= params .maxLength &&
169
169
isNotSpam (context .feedback )
170
170
);
171
171
},
You can’t perform that action at this time.
0 commit comments