ng effects
1.0.0
Observação | Este repositório não é mais mantido. A história continua na API de composição angular. |
Sistema de reatividade para angular. Com base na API de composição do VUE.
Referência da API ⚡ Stackblitz Changelog
Observação | Procurando os documentos anteriores (9.0.x)? Clique aqui. |
@ Component ( {
selector : "app-root" ,
inputs : [ "count" ] ,
outputs : [ "countChange" ]
} )
export class AppComponent extends defineComponent ( ( ) => {
const count = ref ( 0 )
const countChange = new EventEmitter < number > ( )
function increment ( ) {
count . value += 1
}
watchEffect ( ( ) => {
countChange . emit ( count . value )
} )
return {
count ,
countChange ,
increment ,
}
} ) { } Instale via npm
npm install ng-effects