duck.html.components.core.mutation

Module that keeps track of components mutation.

Module Contents

Classes

Mutation

Mutation class to represent mutations.

MutationCode

Functions

on_mutation

Entry function to be executed when a mutation happens.

API

class duck.html.components.core.mutation.Mutation(target, code: duck.html.components.core.mutation.MutationCode, payload: Dict[Any, Any])[source]

Mutation class to represent mutations.

Initialization

__repr__()[source]
__slots__

(‘target’, ‘code’, ‘payload’)

__str__

None

class duck.html.components.core.mutation.MutationCode[source]

Bases: enum.IntEnum

DELETE_CHILD

0

DELETE_PROP

2

DELETE_STYLE

4

INSERT_CHILD

1

SET_INNER_HTML

None

SET_PROP

3

SET_STYLE

5

duck.html.components.core.mutation.on_mutation(target, mutation: duck.html.components.core.mutation.Mutation)[source]

Entry function to be executed when a mutation happens.

Notes:

  • Every mutation is propagated in the following order:

    target -> parent (if available) -> components in between -> root (if available)