*The 'actionMixin' means the Action object mix up with external Action. The 'base' is required.*
- What functions are available from the base of the maka engine?
Function Name | Description | Example in Action | Example in View
--- | -- | --- | ---
getState | get value in the state by path | this.base.getState('data.input') | $base.getState('data.input')
setState | set value in the state by path | this.base.setState({'data.input', 'hello'}) | $base.setState({'data.input', 'hello'})
gs | =getState | this.base.gs('data.input') | $base.gs('data.input')
ss | =setState | this.base.ss({'data.input', 'hello'}) |$base.ss({'data.input', 'hello'})
- To mix in custom action classes
```javascript
import { actionMixin, registerAction } from 'maka'
class CustomAction {
alert = () => {
alert()
}
}
registerAction('CustomAction', CustomAction)
@actionMixin('base', 'CustomAction')
class action {
constructor(option) {
Object.assign(this, option.mixins)
}
}
const view = {
component: 'div',
onClick: '{{$CustomAction.alert}}'
}
```
- Introduction
- What is maka?
- Installation
- Getting Started
- Command Line Tool
- Main concepts
- State
- Action
- View
- Advanced concepts
- Expression
- View reserved keywords
- Custom components
- Custom template components
- ActionMixin
- App && Hub
- App
- Hub
- Maka API
- Maka Api
- Ajax && Mock
- Ajax
- Mock
- Navigate
- navigate
- Team
- Our Team
- Done