meteor - What does api.imply do? -
from meteor docs:
give users of package access package (by passing in string
packagename) or collection of packages (by passing in array of strings[packagename1, packagename2]).
i have no idea means.
this question know imply can employed use.
what api.imply do?
what's difference between api.use , api.imply?
api.use gives package access other packages exported symbols.
for example need api.use("random") (see how it's done in accounts-base package) if want use random symbol in package code (see how random package.js api.exporting random).
however, meteor adding accounts-base wouldn't give whole application access used packages (random in case). if app needs random, you'd still need meteor add it.
api.imply on other hand, gives whole application access package exported symbols.
for example, see how accounts-google api.implying accounts-base.
accounts-base responsible exporting accounts symbol, when meteor add accounts-google, not accounts-base added in application dependencies, accounts-base symbols made available in app, because implied.
accounts-base both using accounts in own code (api.use) , exporting dependencies symbols whole app (api.imply).
api.imply can used make "shadow packages" pulling in other packages.
for example, @ point mdg renamed showdown package markdown, have stated meteor remove showdown && meteor add markdown, have required actions on end users.
what did instead keeping showdown package , make implying new markdown package.
Comments
Post a Comment