Skip to content

Support sr.bind()#9

Open
goto-bus-stop wants to merge 1 commit intodefaultfrom
bound
Open

Support sr.bind()#9
goto-bus-stop wants to merge 1 commit intodefaultfrom
bound

Conversation

@goto-bus-stop
Copy link
Copy Markdown
Owner

Going to be useful for a loadable-component thing I'm working on.

var sr = require('split-require')
var component = loadableComponent({
  load: sr.bind(null, './whatever')
  // vs function (cb) { sr('./whatever', cb) }
})

Comment thread plugin.js

function processBoundSplitRequire (row, node) {
var requirePath = node.arguments[1].arguments[0].value
var resolved = row.deps[requirePath]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can also use this code for sr.call(null, 'whatever'), i think.

@goto-bus-stop goto-bus-stop changed the base branch from master to default November 19, 2020 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant