naeka / ember-custom-actions Goto Github PK
View Code? Open in Web Editor NEWEmber Custom Actions is a package for defining custom API actions, dedicated for Ember 3.24 (and higher) applications.
License: MIT License
Ember Custom Actions is a package for defining custom API actions, dedicated for Ember 3.24 (and higher) applications.
License: MIT License
Hi,
I tried to switch from https://github.com/Exelord/ember-custom-actions to this add-on & had some trouble with the decorator.
The decorators always redefine custom actions methods & does not allow to customize these methods on the class using the decorators...
So I end up by using the decorator in the application adapter to allow child adapter to overrides custom actions methods...
When reading, the doc, it does not seems to be the behavior wanted
Maybe the decorator should replace the class methods only when they are undefined
to prevent this ?
Just for information the code I use :
import ApplicationAdapter from './application'
import { withCustomActions } from '@naeka/ember-custom-actions'
@withCustomActions
export default class RuleBaseAdapter extends ApplicationAdapter {
urlForCustomAction(modelName, id, snapshot, actionId) {
// handling some custom url here
}
}
import Model from '@ember-data/model'
import { customAction } from '@naeka/ember-custom-actions'
export default class RuleBaseModel extends Model {
...
updateCategory = customAction('updateCategory')
}
& when calling model.updateCategory()
it never call the adapter.urlForCustomAction
but call the default method created in the decorator (here)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.