Skip to content

Commit

Permalink
Mute WIP api examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zerobias committed Feb 4, 2025
1 parent cd2a0de commit 1928deb
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions packages/core/src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@ const $email = createStore('');
const triggerValidation = createEvent<number>();
const validateDefaultFx = createEffect((age: number): boolean => true);

const profile = model({
props: {
age: 0,
email: $email,
triggerValidation,
validateDefaultFx,
validateFx: (email: string): boolean => true,
click: define.event<void>(),
},
create({ age, email, triggerValidation, validateDefaultFx, validateFx }) {
return {
foo: createStore(0),
};
},
});
// const profile = model({
// props: {
// age: 0,
// email: $email,
// triggerValidation,
// validateDefaultFx,
// validateFx: (email: string): boolean => true,
// click: define.event<void>(),
// },
// create({ age, email, triggerValidation, validateDefaultFx, validateFx }) {
// return {
// foo: createStore(0),
// };
// },
// });

const aliceProfile = spawn(profile, {
age: createStore(18),
email: '',
validateDefaultFx: (age) => age > 18,
validateFx: createEffect((email: string) => email.length > 0),
// triggerValidation: createEvent(),
click: createEvent(),
});
// const aliceProfile = spawn(profile, {
// age: createStore(18),
// email: '',
// validateDefaultFx: (age) => age > 18,
// validateFx: createEffect((email: string) => email.length > 0),
// // triggerValidation: createEvent(),
// click: createEvent(),
// });

const bobProfile = spawn(profile, {
age: 20,
email: createStore(''),
validateDefaultFx: createEffect((age: number) => age > 18),
validateFx: async (email) => email.length > 0,
click: createEvent(),
});
// const bobProfile = spawn(profile, {
// age: 20,
// email: createStore(''),
// validateDefaultFx: createEffect((age: number) => age > 18),
// validateFx: async (email) => email.length > 0,
// click: createEvent(),
// });

type Field = {
name: string;
Expand Down

0 comments on commit 1928deb

Please sign in to comment.