@@ -11,38 +11,38 @@ const $email = createStore('');
1111const triggerValidation = createEvent < number > ( ) ;
1212const validateDefaultFx = createEffect ( ( age : number ) : boolean => true ) ;
1313
14- const profile = model ( {
15- props : {
16- age : 0 ,
17- email : $email ,
18- triggerValidation,
19- validateDefaultFx,
20- validateFx : ( email : string ) : boolean => true ,
21- click : define . event < void > ( ) ,
22- } ,
23- create ( { age, email, triggerValidation, validateDefaultFx, validateFx } ) {
24- return {
25- foo : createStore ( 0 ) ,
26- } ;
27- } ,
28- } ) ;
14+ // const profile = model({
15+ // props: {
16+ // age: 0,
17+ // email: $email,
18+ // triggerValidation,
19+ // validateDefaultFx,
20+ // validateFx: (email: string): boolean => true,
21+ // click: define.event<void>(),
22+ // },
23+ // create({ age, email, triggerValidation, validateDefaultFx, validateFx }) {
24+ // return {
25+ // foo: createStore(0),
26+ // };
27+ // },
28+ // });
2929
30- const aliceProfile = spawn ( profile , {
31- age : createStore ( 18 ) ,
32- email : '' ,
33- validateDefaultFx : ( age ) => age > 18 ,
34- validateFx : createEffect ( ( email : string ) => email . length > 0 ) ,
35- // triggerValidation: createEvent(),
36- click : createEvent ( ) ,
37- } ) ;
30+ // const aliceProfile = spawn(profile, {
31+ // age: createStore(18),
32+ // email: '',
33+ // validateDefaultFx: (age) => age > 18,
34+ // validateFx: createEffect((email: string) => email.length > 0),
35+ // // triggerValidation: createEvent(),
36+ // click: createEvent(),
37+ // });
3838
39- const bobProfile = spawn ( profile , {
40- age : 20 ,
41- email : createStore ( '' ) ,
42- validateDefaultFx : createEffect ( ( age : number ) => age > 18 ) ,
43- validateFx : async ( email ) => email . length > 0 ,
44- click : createEvent ( ) ,
45- } ) ;
39+ // const bobProfile = spawn(profile, {
40+ // age: 20,
41+ // email: createStore(''),
42+ // validateDefaultFx: createEffect((age: number) => age > 18),
43+ // validateFx: async (email) => email.length > 0,
44+ // click: createEvent(),
45+ // });
4646
4747type Field = {
4848 name : string ;
0 commit comments