callum / morphdom-hooks

17 stars 2 forks source link

Remove dependency on assert #2

Closed jamesplease closed 8 years ago

jamesplease commented 8 years ago

The tests prob. need to be updated, but this makes this thing work in browserz

jamesplease commented 8 years ago

Actually – it could just use the callable fn.

tbranyen commented 8 years ago

I've been doing this lately: browserify -r assert -s assert -o assert.js and then:

var assert = require('./assert')

Granted this PR adds another file to commit, but it does work in browser/node.

jamesplease commented 8 years ago

That's pretty cool, @tbranyen ; I hadn't thought of doing that. With that said, sending down the entire assert module to the browser simply to verify that a variable is a function seems a lil inefficient to me. What do you think?

tbranyen commented 8 years ago

Yeah could be overkill, esp. if this module doesn't balloon out with edge case fixes.

callum commented 8 years ago

I hadn't actually seen this until I had already done it. Thanks @jmeas

jamesplease commented 8 years ago

np ✌️