Skip to content

Commit

Permalink
Update wording on pure function definition. (#2556)
Browse files Browse the repository at this point in the history
I was originally going to put a PR to fix "has not side-effects", but I also re-read this sentence and realized it could be interpreted as saying a pure function returns its parameters, not a deterministic value based on its parameters.
  • Loading branch information
askreet authored Mar 27, 2022
1 parent 2209db7 commit e1f89a8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Pure Components"

## Pure function definition

A function is considered pure when the return values are always identical to passed down parameters. And it has not side-effects.
A function is considered pure when the return values are deterministic given the same parameters, and it has no side-effects.

## Pure components

Expand Down

1 comment on commit e1f89a8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yew master branch benchmarks (Lower is better)

Benchmark suite Current: e1f89a8 Previous: 2209db7 Ratio
yew-struct-keyed 01_run1k 175.63150000000002 158.5 1.11
yew-struct-keyed 02_replace1k 186.3975 189.148 0.99
yew-struct-keyed 03_update10th1k_x16 383.614 392.992 0.98
yew-struct-keyed 04_select1k 81.82900000000001 79.88149999999999 1.02
yew-struct-keyed 05_swap1k 92.8895 91.705 1.01
yew-struct-keyed 06_remove-one-1k 29.4085 28.292 1.04
yew-struct-keyed 07_create10k 2061.8379999999997 2077.8495000000003 0.99
yew-struct-keyed 08_create1k-after1k_x2 395.1085 394.531 1.00
yew-struct-keyed 09_clear1k_x8 205.3965 197.641 1.04
yew-struct-keyed 21_ready-memory 0.9634475708007812 0.9634475708007812 1
yew-struct-keyed 22_run-memory 1.5048255920410156 1.5048294067382812 1.00
yew-struct-keyed 23_update5-memory 1.4602203369140625 1.4602203369140625 1
yew-struct-keyed 24_run5-memory 1.5121383666992188 1.5052261352539062 1.00
yew-struct-keyed 25_run-clear-memory 1.1243438720703125 1.126495361328125 1.00
yew-struct-keyed 31_startup-ci 1730.208 1859.53975 0.93
yew-struct-keyed 32_startup-bt 29.46599999999999 31.497999999999987 0.94
yew-struct-keyed 34_startup-totalbytes 330.5556640625 330.5556640625 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.