(function(root, factory) {
  if(typeof define === 'function' && define.amd) {
    define([], factory)
  } else if (typeof module === 'object' && module.exports) {
    module.exports = factory()
  } else {
    root['wraptor'] = factory()
  }
}(this, function() {
  const slice = Array.prototype.slice

  function isFunction(fn) {
    return (fn && typeof fn === 'function')
  }

  function notifyNext(x, o) { o.next(x) }

  function notifyError(err, o) {
    if(isFunction(o.error)) {
      o.error(err)
    } else {
      throw err
    }
  }

  return function wraptor(fn) {
    if(!(isFunction(fn))) {
      throw new TypeError('Must provide a function to wrap')
    }

    const safeFn  = fn.bind(null)
    const subs    = []
    const done    = false

    function unsubscribe(o) {
      const idx = subs.indexOf(o)
      if(idx !== -1) { subs.splice(idx, 1) }
    }

    function subscribe(o) {
      if(!(o && isFunction(o.next))) {
        throw new TypeError('Invalid Observer passed to subscribe')
      }

      if(subs.indexOf(o) === -1) { subs.push(o) }

      return {
        closed,
        unsubscribe: unsubscribe.bind(null, o)
      }
    }

    function ObservableFunction() {
      if(subs.length) {
        const args = slice.call(arguments)

        try {
          const _val = safeFn.apply(null, args)
          subs.forEach(notifyNext.bind(null, _val))
        } catch(e) {
          subs.forEach(notifyError.bind(null, e))
        }
      }
    }

    ObservableFunction[Symbol.observable] = () => {
      return { subscribe }
    }

    ObservableFunction.subscribe = subscribe

    return ObservableFunction
  }
}))

@@ -536,16 +536,108 @@
  %7D%0A  %7D%0A%0A
+  function partial(fn, args) %7B%0A    return Function.bind.apply(fn, %5Bnull%5D.concat(args))%0A  %7D%0A%0A
   return
@@ -774,16 +774,20 @@
 safeFn  
+    
 = fn.bin
@@ -808,162 +808,148 @@
 nst 
-subs    = %5B%5D%0A    const done    = false%0A%0A    function unsubscribe(o) %7B
+argsLength  = safeFn.length%0A    const partialFunc = partial.bind(null, ObservableFunction)%0A
 %0A    
-  
 const 
-idx = subs.indexOf(o)%0A      if(idx !== -1) %7B subs.splice(idx, 1) %7D%0A    %7D
+subs    = %5B%5D%0A    const done    = false
 %0A%0A  
@@ -1170,16 +1170,28 @@
   closed
+: () =%3E done
 ,%0A      
@@ -1207,157 +1207,283 @@
 ribe
-: unsubscribe.bind(null, o)%0A      %7D%0A    %7D%0A%0A    function ObservableFunction() %7B%0A      if(subs.length) %7B%0A        const args = slice.call(arguments)%0A%0A  
+()  %7B%0A          const idx = subs.indexOf(o)%0A          if(idx !== -1) %7B subs.splice(idx, 1) %7D%0A        %7D%0A      %7D%0A    %7D%0A%0A    function ObservableFunction() %7B%0A      const args = slice.call(arguments)%0A%0A      if(args.length %3C argsLength) %7B%0A        return partialFunc(args)%0A      %7D%0A%0A
     
@@ -1494,26 +1494,24 @@
 y %7B%0A        
- 
- 
 const _val =
@@ -1532,26 +1532,102 @@
 null, args)%0A
+%0A
   
+      if(isFunction(_val)) %7B%0A          return partialFunc(args)%0A        %7D%0A%0A
         subs
@@ -1664,18 +1664,37 @@
  _val))%0A
+%0A
   
+      return _val%0A
       %7D 
@@ -1700,26 +1700,24 @@
  catch(e) %7B%0A
-  
         subs
@@ -1752,26 +1752,16 @@
 ll, e))%0A
-        %7D%0A
       %7D%0A

add auto-partial and accept curried functions