0.1.7 • Published 10 months ago

@brease/react v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.7

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.6

10 months ago

0.1.5

11 months ago

0.0.2

2 years ago

0.0.1

2 years ago