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’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

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ npm install ember-statechart-component
yarn add ember-statechart-component
```

### Optional
Copy link
Owner

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

Copy link
Contributor Author

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.


To be able to use XState [`state.matches`](https://xstate.js.org/api/classes/state.html#matches)
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 state object", so instead I just merged in the information here. It is quite a good term to grep for later on in the README, so it seems ok to me. Happy to change.

method in our templates,
we will first need a `HelperManager` for
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe link to helper managers, too?
emberjs/rfcs#625

handling vanilla functions.
[ember-could-get-used-to-this](https://github.com/pzuraq/ember-could-get-used-to-this)
Copy link
Owner

Choose a reason for hiding this comment

The 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
And in ember 4.3ish, hopefully it won't even be needed due to implementing this RFC: emberjs/rfcs#756

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
------------------------------------------------------------------------------

Expand Down Expand Up @@ -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')}}
Expand Down