Skip to content

.butIfIdont? for .iDontAlways.butWhenIdo #38

Description

@brandonscript
Bro(app)
    .iDontAlways('config.environment.buildURL')
    .butWhenIdo(function(buildURL){
        myURL = buildURL('dev');
    });

This is awesome, but sometimes it's great to not have to check the property again to handle an 'else' exception. Something like:

Bro(app)
    .iDontAlways('config.environment.buildURL')
    .butWhenIdo(function(buildURL){
        myURL = buildURL('dev');
    })
    .butIfIdont(function() {
        // do other stuff
    });

Tried to wire in something like this, but it blew up when trying to add in the fallback function.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions