AhmedYahya24 / spzceX

0 stars 1 forks source link

Pure vs Impure functions #12

Open NouraldinS opened 2 years ago

NouraldinS commented 2 years ago

The context will always enforce the behavior, and there's no general rule that says what you can and can't do for every case, but here you do not need to have an impure function. Always prefer to go pure and not cause side-effects to running any function. read

https://github.com/AhmedYahya24/spzceX/blob/d753e7f6e31fa36501ca331d113bc0521a555a4d/space-x-graphql/src/utils/functions/setInDataSource.js#L1-L28