This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => { | |
if (event.type !== 'SEARCH_REQUEST_SUCCESS') { | |
throw new Error( | |
`Unexpected event type for handleRequestSuccess: "${event.type}"` | |
); | |
} | |
return event.results; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => { | |
if (event.type !== 'SEARCH_REQUEST_SUCCESS') { | |
throw new Error( | |
`Unexpected event type for handleRequestSuccess: "${event.type}"` | |
); | |
} | |
return event.results; | |
}, | |
pagination: (_ctx, event) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results, | |
pagination: (_ctx, event) => event.pagination | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
pagination: null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results, | |
pagination: (_ctx, event) => event.pagination | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleRequestSuccess = assign({ | |
results: (_ctx, event) => event.results | |
}); | |
const searchStateMachine = Machine({ | |
id: 'search', | |
initial: 'idle', | |
context: { | |
results: [] |
NewerOlder