mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
8466adcff1
commit
9c075a825f
1 changed files with 3 additions and 4 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
use mlua::{ExternalResult, Function, Lua, Value};
|
use mlua::{ExternalResult, Function, Lua, Value};
|
||||||
use yazi_dds::body::Body;
|
use yazi_dds::body::Body;
|
||||||
use yazi_shared::Id;
|
|
||||||
|
|
||||||
use crate::runtime::RtRef;
|
use crate::{Id, runtime::RtRef};
|
||||||
|
|
||||||
pub struct Pubsub;
|
pub struct Pubsub;
|
||||||
|
|
||||||
|
|
@ -15,8 +14,8 @@ impl Pubsub {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn pub_to(lua: &Lua) -> mlua::Result<Function> {
|
pub(super) fn pub_to(lua: &Lua) -> mlua::Result<Function> {
|
||||||
lua.create_function(|_, (receiver, kind, value): (u64, mlua::String, Value)| {
|
lua.create_function(|_, (receiver, kind, value): (Id, mlua::String, Value)| {
|
||||||
yazi_dds::Pubsub::pub_to(Id(receiver), Body::from_lua(&kind.to_str()?, value)?);
|
yazi_dds::Pubsub::pub_to(*receiver, Body::from_lua(&kind.to_str()?, value)?);
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue