0.1.7 • Published 2 years ago

@brease/react v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Multiple contexts

## Different contexts Each context and their execution is scoped to its own store. You can use as many different contexts in parallel as you need. For example:

const { result: order } = useRules("checkout", user);
const { result: order } = useRules("colors", user);

Same context for multiple objects

If you have to run business rules for multiple objects of a context, you must add a distinct identifier:

const { result: order1 } = useRules("checkout", user1, { objectID: "u1" });
const { result: order2 } = useRules("checkout", user2, { objectID: "u2" });

Otherwise both order1 and order2 end up share the refer to user2 with applied actions. They would use the same rules store and the last execution wins. https://dotindustries.notion.site/Type-inheritance-0ac344df4a6c4821870c3fd6b374d0ed

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.2

3 years ago

0.0.1

3 years ago