MCPcopy
hub / github.com/dvajs/dva / model

Function model

packages/dva-core/src/index.js:55–62  ·  view source on GitHub ↗

* Register model before app is started. * * @param m {Object} model to register

(m)

Source from the content-addressed store, hash-verified

53 * @param m {Object} model to register
54 */
55 function model(m) {
56 if (process.env.NODE_ENV !== 'production') {
57 checkModel(m, app._models);
58 }
59 const prefixedModel = prefixNamespace({ ...m });
60 app._models.push(prefixedModel);
61 return prefixedModel;
62 }
63
64 /**
65 * Inject model after app is started.

Callers 1

injectModelFunction · 0.85

Calls 2

checkModelFunction · 0.85
prefixNamespaceFunction · 0.85

Tested by

no test coverage detected