-
Notifications
You must be signed in to change notification settings - Fork 50
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
Document "Octane" usage #413
Comments
I'm at a point where I want to try using this add-on, so I'm going to use as-is without ES6 classes on my models for now -- but there's been a little bit of discussion in the ember-data discord about goals of modernizing this add-on. https://discordapp.com/channels/480462759797063690/486549196837486592/695640101375705128 |
I think we definitely need #428 to landed before putting any Octane documentation 🙏 |
+1 on #428 |
Seeing as how #428 still isn't merged, how are people using these APIs today? Is there a TS friendly way to do it? |
@machty you might be interested in rust-lang/crates.io#5126. my plan is to extract that into a standalone addon once I have enough time and it's not using TS yet, but since it doesn't use decorators it most likely shouldn't be that hard to add types. |
I'm very interested in seeing octane/typescript supported. :) |
Just for posterity, here's the general pattern I'm using for a TypeScript + Octane context (Ember Data 3.27) export default class MessageReceipt extends Model {
// ...
declare preview: (payload: any) => Promise<any>
}
MessageReceipt.prototype.preview = memberAction({
path: `preview`,
type: `put`,
}) tl;dr if you |
This Ember Octane the default will be to use ES6 classes for models. The README of this project will have to be adjusted to show how to use this addon with ES6 classes.
Example:
(thanks you to @rwjblue, who suggested the snippet above)
This is not exactly pretty though, so we might want to think about new API patterns that we can use in the Octane world in the future.
The text was updated successfully, but these errors were encountered: