Skip to content

Configuring mergeWithDefaults Method to Return Defaults#170

Open
eugenedw wants to merge 3 commits intokatzer:masterfrom
eugenedw:master
Open

Configuring mergeWithDefaults Method to Return Defaults#170
eugenedw wants to merge 3 commits intokatzer:masterfrom
eugenedw:master

Conversation

@eugenedw
Copy link

When calling the printer.pick method, the APPPrinter.m class method fails since options are expected, but none are passed.

    NSMutableDictionary* settings = [arguments objectAtIndex:0];
    NSArray* bounds = [settings objectForKey:@"bounds"];

(the settings are "null" here).

The decorator associated with the typescript resource for the plugin doesn't allow options to be provided and, subsequently, the option merge returns undefined for the params:

params = this.mergeWithDefaults(params);

I've implemented a workaround so that the plugin.js "mergeWithDefaults" returns the defaults when none are passed or an empty object when an empty object is passed in, but this seems like a hack.

this method is returning undefined when attempting to perform printer pick(s). as a result, underlying iOS processes fail as the "pick" method requires options be passed (particularly "bounds").
Issues arose when attempting to perform "pick" requests since the latest version (Typescript) of the plugin doesn't provide a means of sending options.
configuring options merge return defaults on empty
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