Releases: bottenderjs/bottender-compose
Releases · bottenderjs/bottender-compose
0.14.0 / 2019-09-20
- [new] add better naming to the return functions
0.13.0 / 2019-02-19
- [breaking] rename param to props in effects and template (#95)
params
is deprecated. Use props
instead.
In effect
:
effect(
// function has side effects
async context => {
await doSomeSideEffects();
return {
derivedState: {
x: 1,
},
derivedProps: {
y: 2,
},
};
},
// action
async (context, props) => {
console.log(context.state.x); // 1
console.log(props.y); // 2
}
);
In template: Hi, {{ props.name }}
0.12.7 / 2019-02-01
- [new] support isMemberJoined, isMemberLeft predicates (#94)
B.isMemberJoined();
B.isMemberLeft();
0.12.6 / 2018-12-11
- [fix] support Chinese variable (#92)
0.12.5 / 2018-09-18
- [new] support facebook
sendLike
0.12.4 / 2018-09-06
- [fix] pass required otherArgs to compileTemplate
0.12.3 / 2018-09-06
- [improve] improve warning when compiling template #82
Before:
Properties accessors in template is invalid -- expected return a string but got: object
After:
Properties accessors (context.session.user) in template is invalid -- expected return a non-empty string but got: object
0.12.2 / 2018-09-05
- [new] add param support for template string:
use param
to access object values that provided as sencond argument when calling action:
B.sendText('User: {{param.name}}')(context, { name: 'Super User' });
0.12.1 / 2018-09-05
- [fix] add missing export for
attachOptions
.
0.12.0 / 2018-09-05
- [new] add
attachOptions
:
attachOptions
Attaches additional options to the action.
const { attachOptions, sendText } = require('bottender-compose');
bot.onEvent(
attachOptions({ tag: 'ISSUE_RESOLUTION' }, sendText('Issue Resolved'))
);
// curry function
const attachIssueResolutionTag = attachOptions({ tag: 'ISSUE_RESOLUTION' });
bot.onEvent(attachIssueResolutionTag(sendText('Issue Resolved')));