Skip to content

Conversation

@Deraen
Copy link
Member

@Deraen Deraen commented Sep 3, 2021

Related to #546

react name is already so overloaded that I think we want to avoid that.

Looks like just calling notify-deref-watcher! is enough. That function doesn't modify the atom itself, but stores reference to current reactive context to the atom. Reagent will then use IWatchable -add-watch (and -remove-watch) to make reactive context to listen to this atom. Because regular atom implements this protocol same as Ratom.

While it would be simple to just provide single function to use instead of regular deref to use with normal atoms, I think better API might be to provide function to wrap atoms, so we can replace deref implementation. This way we could later also modify other methods, if necessary for some reason.

@pepijndevos
Copy link

Maybe the watch function should pass the wrapper reference?

@Deraen Deraen marked this pull request as draft January 28, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants