bottenderjs / bottender-recognizer

Build bottender bots with intent recognizer and action resolver.
MIT License
0 stars 0 forks source link

Separate action function and action name #11

Closed Calvin-Lin closed 6 years ago

Calvin-Lin commented 6 years ago

It's not convenient that every action function should have name property. https://github.com/Yoctol/bottender-recognizer/blob/master/src/index.js#L66

How about let resolver return action function and action name separately? Like this

const {name, action} = resolver(context.state, intent);
chentsulin commented 6 years ago

or may be we can implement something like this: https://github.com/acdlite/recompose/blob/master/docs/API.md#setdisplayname

chentsulin commented 6 years ago

https://github.com/Yoctol/bottender-compose/pull/57