-
Notifications
You must be signed in to change notification settings - Fork 6
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(readme): explain role of ember-could-get-used-to-this better #189
Changes from 1 commit
df88aaf
3b99f98
f7221b5
f51133d
7168d4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,23 @@ npm install ember-statechart-component | |
yarn add ember-statechart-component | ||
``` | ||
|
||
### Optional | ||
|
||
To be able to use XState [`state.matches`](https://xstate.js.org/api/classes/state.html#matches) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got a little bit tangled in English sentence structure with the "which is available on the |
||
method in our templates, | ||
we will first need a `HelperManager` for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe link to helper managers, too? |
||
handling vanilla functions. | ||
[ember-could-get-used-to-this](https://github.com/pzuraq/ember-could-get-used-to-this) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should mention this addon anymore. There is: https://github.com/NullVoxPopuli/ember-functions-as-helper-polyfill There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh, #TIL about ember-function-as-helper-polyfill. I do think however that in some form this needs to stay here, because not everyone's code will be on 4.3+. I will change to use the other addon. Once 4.3(ish) is released, the readme can be changed to give an option to skip this. |
||
provides one: | ||
|
||
```bash | ||
ember install ember-could-get-used-to-this | ||
# or | ||
npm install ember-could-get-used-to-this | ||
# or | ||
yarn add ember-could-get-used-to-this | ||
``` | ||
|
||
Usage | ||
------------------------------------------------------------------------------ | ||
|
||
|
@@ -104,14 +121,6 @@ Usage: | |
|
||
### Matching States | ||
|
||
XState provides its own [`matches`](https://xstate.js.org/api/classes/state.html#matches) | ||
method which is available on the `state` object. | ||
We can utilize this provided there exists a `HelperManager` for | ||
handling vanilla functions, such as what | ||
[ember-could-get-used-to-this](https://github.com/pzuraq/ember-could-get-used-to-this) | ||
provides. | ||
|
||
|
||
```hbs | ||
<Toggle as |state send|> | ||
{{#if (state.matches 'inactive')}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move this under optional?
It'd be reallly awkward to use this library without the rfc 756 behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. I understood that it's only needed for
state.matches
calls. Which is immensely useful. Just not necessary. But yeh, good defaults.