Closed vadimdemedes closed 7 years ago
Is there a better workaround for using return
in cli.js, aside extracting code into a separate file?
Is there a better workaround for using
return
in cli.js, aside extracting code into a separate file?
No... You can't return
top-level. We only could that in CommonJS Node.js because it was wrapped in an IIFE.
I'm getting an error when running it locally:
/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:10
const isClassComponent = component => component.prototype instanceof Component;
^
TypeError: Cannot read property 'prototype' of undefined
at isClassComponent (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:10:48)
at new Instance (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:40:27)
at getOrCreateInstance (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:20:14)
at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:84:27)
at Array.forEach (native)
at Instance.mount (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:82:17)
at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:87:19)
at Array.forEach (native)
at Instance.mount (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:82:17)
at children.forEach.child (/Users/sindresorhus/dev/oss/emoj/node_modules/ink/lib/instance.js:87:19)
I'm getting an error when running it locally:
Do you see this immediately after execution or after some actions?
Oh no, I forgot to push latest changes. You should be able to run it now ;)
Instead of using the underline
style to indicate the selected emoji, I think it would look better to use ^
(with the color green or cyan?) and place it on the next line.
Agree, ^
is more visible than underline. I guess cyan should look best, but I'll try the other ones too ;)
How about using ↑
instead of ^
? It looks more aligned to the start of the emoji.
vs
How about using
↑
instead of^
?
👍
Cool, in that case it's ready ;)
The arrow doesn't move correctly. This is the maximum it goes:
😄 🎉 😁 😃 😊 ☺ 👍🏽
↑
Could you also make it circular, so when it goes beyond either side it starts on the different side?
Run npm update and it should be fine. I should publish ink as a scoped package to prevent these kinds of errors.
Re circular, sure!
Released Ink on npm and updated PR to use it. Should be fine now.
This is amazing and the JSX thing makes it so much more readable.
@vadimdemedes I opened an issue https://github.com/sindresorhus/emoj/issues/21 for:
Re circular, sure!
I just noticed one small issue. When you write a search query, then use backspace until the search query is gone, the last search result is still there, but you can't move the arrow selector. It should clear the search result in that case.
Thanks, will fix!
Let's spill some ink on
emoj
!Added features and fixed bugs: