classdojo / crisco

MIT License
0 stars 0 forks source link

CriscoModel should cache results of targets and getParams #9

Open cdolivares opened 11 years ago

cdolivares commented 11 years ago
  targets: () ->
    @__cache['targets'] ||  @__cache['targets'] = _.reject(  #simplify and make more robust.
        _.reject(
            @__routeInfo.route.path.split('/'),
            (r) ->
              return (r.indexOf(":") isnt -1)
        ), 
        (r2) ->
          ((r2.length < 1) or (r2 is 'api'))
    ).reverse()