Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
worldoptimizer committed Dec 5, 2019
1 parent 0aae7d0 commit 80ecd8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -10,9 +10,9 @@ Usage: After registering the dataset keys with `HypeDataFill.mapDatasetToClass`
Notes for version 1.1
---

**Example:** You mapped `data-user` to the class `.date-user` with `HypeDataFill.mapDatasetToClass('user', '.data-user');` in your Head HTML. When ever you assign `data-user` on a group or symbol all children with the class `.date-user` will be updated. If you are doing this assignment in the IDE it will be set by Hype on every scene load. To avoid that just set `.date-user-initial` instead.
**Example:** You mapped `data-user` to the class `.date-user` with `HypeDataFill.mapDatasetToClass('user', '.data-user');` in your Head HTML. Whenever you assign `data-user` on a group or symbol all children with the class `.date-user` will be updated. If you are doing this assignment in the IDE it will be set by Hype on every scene load. To avoid that just set `.date-user-initial` instead.

**Explanation of initial-clause:** All values set with the attribute panel in Hype are persistent duo to the Hype runtime refreshing them on each scene load. This little "genie" at work might be what people expect using the IDE but it certainly isn't how programmers updating values per script would expect things to behave. Hype DataFill 1.1 now has a baked in workaround for this… just add "-initial" to your attribute entry (for example `data-user-initial` given your key is normally `data-user`). Then this value will only be set as an initial value and honor updates done via script like `yourElement.dataset.user = "Max Musterman";` across scene transition. They are anyways honored in a scene context either way.
**Explanation of initial-clause:** All values set with the attribute panel in Hype are persistent duo to the Hype runtime refreshing them on each scene load. This little "genie" at work might be what people expect using the IDE but it certainly isn't how programmers updating values per script would expect things to behave. Hype DataFill 1.1 now has a baked in workaround for this… just add "-initial" to your attribute entry (for example `data-user-initial` given your key is normally `data-user`). Then this value will only be set as an initial value and honor updates done via script like `yourElement.dataset.user = "Max Musterman";` across scene transition. They are anyway honored in a scene context either way.

**Demo Example**\
[HypeDataFill.html ](https://playground.maxziebell.de/Hype/DataFill/HypeDataFill.html)
Expand Down

0 comments on commit 80ecd8e

Please sign in to comment.