Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow useCode 1st parameter to return undefined, null or an array #455

Merged
merged 9 commits into from Nov 28, 2019
Merged

Allow useCode 1st parameter to return undefined, null or an array #455

merged 9 commits into from Nov 28, 2019

Conversation

yairopro
Copy link
Contributor

@yairopro yairopro commented Nov 7, 2019

And makes the code clearer (it seems clearer to me 馃槣)

@osdnk
Copy link
Contributor

osdnk commented Nov 12, 2019

Shouldn't you fix typings or docs?

@yairopro
Copy link
Contributor Author

What do you mean ?

@osdnk
Copy link
Contributor

osdnk commented Nov 13, 2019

Are you that you don't need to change typescript definitions and describe your changes in docs?

src/derived/useCode.js Outdated Show resolved Hide resolved
@yairopro
Copy link
Contributor Author

Are you that you don't need to change typescript definitions and describe your changes in docs?

Oh sorry ! I'm not used to TypeScript, but of course you're right, I'm going to update definitions right away. Thanks fo telling me.
So maybe the documentation won't be needed anymore.

@yairopro
Copy link
Contributor Author

@osdnk TypeScript definition updated.
Be my guess and have a look please.馃榿

@osdnk
Copy link
Contributor

osdnk commented Nov 15, 2019

It should be mentioned in docs :)

@yairopro
Copy link
Contributor Author

@osdnk
JSDoc updated & TypeScript definitions corrected (nodeFactory function can returns an array of nodes).

@osdnk osdnk closed this Nov 21, 2019
@osdnk osdnk reopened this Nov 21, 2019
@osdnk
Copy link
Contributor

osdnk commented Nov 21, 2019

Sorry, I didn't want to close.
Please mention your changes :)

@yairopro
Copy link
Contributor Author

yairopro commented Nov 21, 2019

My changes are for the useCode hook. By giving the possibility to return a null| undefined | boolean, you can set a condition in your hook like so:

useCode(() => 
    condition && [
        // you can return an array directly
    ],
    [...],
)

@osdnk
Copy link
Contributor

osdnk commented Nov 21, 2019

Sorry, i wanted to say: Please mention your changes in documentation

@yairopro
Copy link
Contributor Author

@osdnk
I think it's ready.

@osdnk osdnk merged commit 926d450 into software-mansion:master Nov 28, 2019
@yairopro
Copy link
Contributor Author

馃榿 Thanks @osdnk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants