2015-11-13 6 views

risposta

7

Secondo il doc: http://flowtype.org/docs/functions.html, è necessario fornire il tipo di parametri della funzione e valore restituito: (P1: T1, .., Pn: Tn) => U

Così si supponga che il afterDoneSomething prende un numero e restituire un numero, va annotato come

function doSomething(path:string, afterDoneSomething: (x: number) => number) 
+1

E se la funzione non restituisce nulla? –

+3

@NikSo() => vuoto – targumon

Problemi correlati