hota1024 / twict

A library for Twitter Account Activity API written in TypeScript
MIT License
9 stars 0 forks source link

Fix types and allow emitEvent to handle async operations #5

Closed winstxnhdw closed 2 years ago

winstxnhdw commented 2 years ago

@hota1024 As mentioned in #4, please review the PR.

Additionally, I think it's best if we eliminate onEvent and force users to use the other individual event handlers (e.g. onTweetFavorite) instead. I also propose we remove Express and allow users to implement it themselves if they really need it. This will keep the bundle size small when the library is added to their project. I have tried bundling my project with twict but even esbuild is having trouble tree-shaking the unused Express library out.

hota1024 commented 2 years ago

Thank you! I will check it at night Japan time because I am at work right now.

hota1024 commented 2 years ago

Additionally, I think it's best if we eliminate onEvent and force users to use the other individual event handlers (e.g. onTweetFavorite) instead.

I agree. I will add @deprecated tag to the ActivityEmittable#onEvent in the next version.

hota1024 commented 2 years ago

@winstxnhdw

52285dceb33aaec59b463a75a9f202ab463c6f4b

  • In a Lambda function, this causes the function exit prematurely

Can you give me an example of this?

winstxnhdw commented 2 years ago

@winstxnhdw

52285dc

  • In a Lambda function, this causes the function exit prematurely

Can you give me an example of this?

Sure. https://github.com/winstxnhdw/RenderLaTeX/tree/de64e15bacfea42d5c181358a9322a74b5336d05

hota1024 commented 2 years ago

@winstxnhdw Thank you. I understand. It's an interesting twitter bot. Good luck with the development!

I also propose we remove Express and allow users to implement it themselves if they really need it. This will keep the bundle size small when the library is added to their project. I have tried bundling my project with twict but even esbuild is having trouble tree-shaking the unused Express library out.

Good suggestion! I'll try to come up with an idea. If you have any ideas, plz comment to this issue #6 .

hota1024 commented 2 years ago

Released as v0.0.10 :tada: https://www.npmjs.com/package/twict