Skip to content

Releases: bottenderjs/bottender-compose

0.14.0 / 2019-09-20

20 Sep 09:39
Compare
Choose a tag to compare
  • [new] add better naming to the return functions

0.13.0 / 2019-02-19

20 Sep 09:34
Compare
Choose a tag to compare
  • [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

01 Feb 10:41
Compare
Choose a tag to compare
  • [new] support isMemberJoined, isMemberLeft predicates (#94)
B.isMemberJoined();
B.isMemberLeft();

0.12.6 / 2018-12-11

11 Dec 11:13
Compare
Choose a tag to compare
  • [fix] support Chinese variable (#92)

0.12.5 / 2018-09-18

18 Sep 11:16
Compare
Choose a tag to compare
  • [new] support facebook sendLike

0.12.4 / 2018-09-06

06 Sep 08:24
Compare
Choose a tag to compare
  • [fix] pass required otherArgs to compileTemplate

0.12.3 / 2018-09-06

06 Sep 03:59
Compare
Choose a tag to compare
  • [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

05 Sep 10:00
Compare
Choose a tag to compare
  • [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

05 Sep 05:25
Compare
Choose a tag to compare
  • [fix] add missing export for attachOptions.

0.12.0 / 2018-09-05

05 Sep 05:00
Compare
Choose a tag to compare
  • [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')));