aoye 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aoye.cjs.js +13 -7
- package/dist/aoye.cjs.js.map +1 -1
- package/dist/aoye.esm.js +13 -8
- package/dist/aoye.esm.js.map +1 -1
- package/dist/index.d.ts +10 -3
- package/dist/index.umd.js +13 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/aoye.cjs.js
CHANGED
|
@@ -25,6 +25,12 @@ let ScheduleType = function (ScheduleType) {
|
|
|
25
25
|
ScheduleType[ScheduleType["Post"] = 8] = "Post";
|
|
26
26
|
return ScheduleType;
|
|
27
27
|
}({});
|
|
28
|
+
const EffectStrType2Enum = {
|
|
29
|
+
sync: ScheduleType.Sync,
|
|
30
|
+
pre: ScheduleType.Pre,
|
|
31
|
+
render: ScheduleType.Render,
|
|
32
|
+
post: ScheduleType.Post
|
|
33
|
+
};
|
|
28
34
|
let ScheduleStatus = function (ScheduleStatus) {
|
|
29
35
|
ScheduleStatus[ScheduleStatus["Idle"] = 0] = "Idle";
|
|
30
36
|
ScheduleStatus[ScheduleStatus["Ready"] = 1] = "Ready";
|
|
@@ -1256,14 +1262,12 @@ function $(data) {
|
|
|
1256
1262
|
};
|
|
1257
1263
|
}
|
|
1258
1264
|
}
|
|
1259
|
-
({
|
|
1260
|
-
type: ScheduleType.Sync
|
|
1261
|
-
});
|
|
1262
1265
|
function effectUt(callback, depOrOpt, opt) {
|
|
1263
1266
|
const hasDep = Array.isArray(depOrOpt);
|
|
1264
1267
|
opt = hasDep ? opt || {} : depOrOpt || {};
|
|
1268
|
+
const scheduleType = EffectStrType2Enum[opt.type];
|
|
1265
1269
|
if (!hasDep) {
|
|
1266
|
-
const ef = new Effect(callback,
|
|
1270
|
+
const ef = new Effect(callback, scheduleType);
|
|
1267
1271
|
const run = ef.dispose.bind(ef);
|
|
1268
1272
|
run.ins = ef;
|
|
1269
1273
|
return run;
|
|
@@ -1289,7 +1293,7 @@ function effectUt(callback, depOrOpt, opt) {
|
|
|
1289
1293
|
eff.state &= -257;
|
|
1290
1294
|
}
|
|
1291
1295
|
mounted = true;
|
|
1292
|
-
},
|
|
1296
|
+
}, scheduleType);
|
|
1293
1297
|
const run = ef.dispose.bind(ef);
|
|
1294
1298
|
run.ins = ef;
|
|
1295
1299
|
return run;
|
|
@@ -1297,8 +1301,9 @@ function effectUt(callback, depOrOpt, opt) {
|
|
|
1297
1301
|
function effect(callback, depOrOpt, opt) {
|
|
1298
1302
|
const hasDep = Array.isArray(depOrOpt);
|
|
1299
1303
|
opt = hasDep ? opt || {} : depOrOpt || {};
|
|
1304
|
+
const scheduleType = EffectStrType2Enum[opt.type];
|
|
1300
1305
|
if (!hasDep) {
|
|
1301
|
-
const ef = new Effect(callback,
|
|
1306
|
+
const ef = new Effect(callback, scheduleType);
|
|
1302
1307
|
return ef;
|
|
1303
1308
|
}
|
|
1304
1309
|
let mounted = false;
|
|
@@ -1322,7 +1327,7 @@ function effect(callback, depOrOpt, opt) {
|
|
|
1322
1327
|
eff.state &= -257;
|
|
1323
1328
|
}
|
|
1324
1329
|
mounted = true;
|
|
1325
|
-
},
|
|
1330
|
+
}, scheduleType);
|
|
1326
1331
|
return ef;
|
|
1327
1332
|
}
|
|
1328
1333
|
function scope(...args) {
|
|
@@ -1339,6 +1344,7 @@ function scope(...args) {
|
|
|
1339
1344
|
exports.$ = $;
|
|
1340
1345
|
exports.Computed = Computed;
|
|
1341
1346
|
exports.Effect = Effect;
|
|
1347
|
+
exports.EffectStrType2Enum = EffectStrType2Enum;
|
|
1342
1348
|
exports.IsStore = IsStore;
|
|
1343
1349
|
exports.Keys = Keys;
|
|
1344
1350
|
exports.ScheduleStatus = ScheduleStatus;
|